]> git.wh0rd.org - tt-rss.git/blobdiff - include/db.php
attempt fix db_escape_string() invocation in sessions.php
[tt-rss.git] / include / db.php
index f1a7af363c7b6192caa117633c03c97e20b29499..17437142b57f117203b5447c315c2d6c728c97d0 100644 (file)
@@ -41,13 +41,17 @@ 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);
+               return mysql_real_escape_string($s, $link);
        }
 }