diff --git a/include/db.php b/include/db.php index 17437142b..0f4bf3708 100644 --- a/include/db.php +++ b/include/db.php @@ -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); + } } }