summaryrefslogtreecommitdiff
path: root/include/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-12-02 15:47:28 +0300
committerAndrew Dolgov <[email protected]>2017-12-02 15:47:53 +0300
commite4befe6bf43318766bcfd5a610b26be0aa1f82f0 (patch)
tree9ac566a6c770263091a48240c2887b8dc6224cbb /include/functions.php
parent7a1872c1e08a4c71e901fccecba64942fd6e68b4 (diff)
fix label cache being double escaped on save
remove some old-style escaping
Diffstat (limited to 'include/functions.php')
-rw-r--r--include/functions.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/include/functions.php b/include/functions.php
index 6637bd5d1..459762d58 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -977,10 +977,6 @@
$error_code = 5;
}
- if (db_escape_string("testTEST") != "testTEST") {
- $error_code = 12;
- }
-
return array("code" => $error_code, "message" => $ERRORS[$error_code]);
}
@@ -2218,6 +2214,8 @@
function filter_to_sql($filter, $owner_uid) {
$query = array();
+ $pdo = Db::pdo();
+
if (DB_TYPE == "pgsql")
$reg_qpart = "~";
else
@@ -2230,7 +2228,7 @@
if ($regexp_valid) {
- $rule['reg_exp'] = db_escape_string($rule['reg_exp']);
+ $rule['reg_exp'] = $pdo->quote($rule['reg_exp']);
switch ($rule["type"]) {
case "title":
@@ -2263,7 +2261,7 @@
if (isset($rule['inverse'])) $qpart = "NOT ($qpart)";
if (isset($rule["feed_id"]) && $rule["feed_id"] > 0) {
- $qpart .= " AND feed_id = " . db_escape_string($rule["feed_id"]);
+ $qpart .= " AND feed_id = " . $pdo->quote($rule["feed_id"]);
}
if (isset($rule["cat_id"])) {