diff options
author | Richard Beales <[email protected]> | 2013-03-21 18:57:21 +0000 |
---|---|---|
committer | Richard Beales <[email protected]> | 2013-03-21 18:57:21 +0000 |
commit | 96f19f11d741617b997b4533df50ff8a5b17f46b (patch) | |
tree | 7ae4cc7c4b7192336d86bf4df0dee544f339f168 /include/db.php | |
parent | f1fdfbea433c834ae7f09b4ef23f23d5efa069d4 (diff) | |
parent | 3a693fa76f0cc6a38aa5642a08b48f58c29758bc (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/db.php')
-rw-r--r-- | include/db.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/db.php b/include/db.php index f1a7af363..0f4bf3708 100644 --- a/include/db.php +++ b/include/db.php @@ -41,13 +41,21 @@ function db_connect($host, $user, $pass, $db) { } } -function db_escape_string($s, $strip_tags = true) { +function db_escape_string($s, $strip_tags = true, $link = NULL) { if ($strip_tags) $s = strip_tags($s); if (DB_TYPE == "pgsql") { - return pg_escape_string($s); + if ($link) { + return pg_escape_string($link, $s); + } else { + return pg_escape_string($s); + } } else { - return mysql_real_escape_string($s); + if ($link) { + return mysql_real_escape_string($s, $link); + } else { + return mysql_real_escape_string($s); + } } } |