summaryrefslogtreecommitdiff
path: root/include/db.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-03-21 21:45:00 +0400
committerAndrew Dolgov <[email protected]>2013-03-21 21:45:00 +0400
commit82ac5311549e41893d1430c5090a1d1a925c0c20 (patch)
tree842e73e6225771b4ec1839c950d37d274bd5b712 /include/db.php
parent029591964885e4a9010838cd9ae9824267dc63fc (diff)
fix #2 for mysql escape string
Diffstat (limited to 'include/db.php')
-rw-r--r--include/db.php6
1 files changed, 5 insertions, 1 deletions
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);
+ }
}
}