]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix #2 for mysql escape string
authorAndrew Dolgov <fox@fakecake.org>
Thu, 21 Mar 2013 17:45:00 +0000 (21:45 +0400)
committerAndrew Dolgov <fox@fakecake.org>
Thu, 21 Mar 2013 17:45:00 +0000 (21:45 +0400)
include/db.php

index 17437142b57f117203b5447c315c2d6c728c97d0..0f4bf3708cadc8451cbbcccbb83ac0ae48845f86 100644 (file)
@@ -51,7 +51,11 @@ function db_escape_string($s, $strip_tags = true, $link = NULL) {
                        return pg_escape_string($s);
                }
        } else {
-               return mysql_real_escape_string($s, $link);
+               if ($link) {
+                       return mysql_real_escape_string($s, $link);
+               } else {
+                       return mysql_real_escape_string($s);
+               }
        }
 }