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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user