1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2026-01-10 04:09:16 +00:00

db_escape_string: specify link parameter for consistency; sessions: do not force-close db connection in _close()

This commit is contained in:
Andrew Dolgov
2013-03-22 09:14:55 +04:00
parent 9d9432dab8
commit 3972bf5981
40 changed files with 342 additions and 350 deletions

View File

@@ -41,21 +41,13 @@ function db_connect($host, $user, $pass, $db) {
}
}
function db_escape_string($s, $strip_tags = true, $link = NULL) {
function db_escape_string($link, $s, $strip_tags = true) {
if ($strip_tags) $s = strip_tags($s);
if (DB_TYPE == "pgsql") {
if ($link) {
return pg_escape_string($link, $s);
} else {
return pg_escape_string($s);
}
return pg_escape_string($link, $s);
} else {
if ($link) {
return mysql_real_escape_string($s, $link);
} else {
return mysql_real_escape_string($s);
}
return mysql_real_escape_string($s, $link);
}
}