summaryrefslogtreecommitdiff
path: root/include/db.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-03-22 09:14:55 +0400
committerAndrew Dolgov <[email protected]>2013-03-22 09:14:55 +0400
commit3972bf598195efba3e73ae1fef3faceabeb50308 (patch)
tree0e0d6e4570b9f9ba692ffae40b7d170e356c4ec7 /include/db.php
parent9d9432dab87e3887e4f482ac5afff1586530c692 (diff)
db_escape_string: specify link parameter for consistency; sessions: do not force-close db connection in _close()
Diffstat (limited to 'include/db.php')
-rw-r--r--include/db.php14
1 files changed, 3 insertions, 11 deletions
diff --git a/include/db.php b/include/db.php
index 0f4bf3708..0479df6a9 100644
--- a/include/db.php
+++ b/include/db.php
@@ -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);
}
}