]> git.wh0rd.org - tt-rss.git/blobdiff - include/db.php
Merge pull request #89 from alsvartr/auth_radius
[tt-rss.git] / include / db.php
index f1a7af363c7b6192caa117633c03c97e20b29499..a70a1d87889ad4528141e966e4aee5711c2431b0 100644 (file)
@@ -15,7 +15,7 @@ function db_connect($host, $user, $pass, $db) {
                        $string .= " host=$host";
                }
 
-               if (defined('DB_PORT')) {
+               if (defined('DB_PORT') && DB_PORT) {
                        $string = "$string port=" . DB_PORT;
                }
 
@@ -41,13 +41,13 @@ function db_connect($host, $user, $pass, $db) {
        }
 }
 
-function db_escape_string($s, $strip_tags = true) {
+function db_escape_string($link, $s, $strip_tags = true) {
        if ($strip_tags) $s = strip_tags($s);
 
        if (DB_TYPE == "pgsql") {
-               return pg_escape_string($s);
+               return pg_escape_string($link, $s);
        } else {
-               return mysql_real_escape_string($s);
+               return mysql_real_escape_string($s, $link);
        }
 }