]> git.wh0rd.org Git - tt-rss.git/commitdiff
disallow ; in labels
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 17 May 2008 03:03:03 +0000 (04:03 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 17 May 2008 03:03:03 +0000 (04:03 +0100)
modules/pref-labels.php

index e9e6ee86040084ae1a182ef2b053a60f41af9f4a..3582f42eb533fa92908addab24b351a3593833ac 100644 (file)
@@ -87,6 +87,8 @@
                        $expr = trim($_GET["expr"]);
                        $descr = db_escape_string(trim($_GET["descr"]));
 
+                       $expr = str_replace(";", "", $expr);
+
                        if (!$expr) {
                                print "<div>Error: SQL expression is blank.</div>";
                                return;
                        $sql_exp = db_escape_string(trim($_GET["sql_exp"]));
                        $descr = db_escape_string(trim($_GET["description"]));
                        $label_id = db_escape_string($_GET["id"]);
-                       
+
+                       $sql_exp = str_replace(";", "", $sql_exp);
+
                        $result = db_query($link, "UPDATE ttrss_labels SET 
                                sql_exp = '$sql_exp', 
                                description = '$descr'
                        $sql_exp = db_escape_string(trim($_GET["sql_exp"]));
                        $description = db_escape_string($_GET["description"]);
 
+                       $sql_exp = str_replace(";", "", $sql_exp);
+
                        if (!$sql_exp || !$description) return;
 
                        $result = db_query($link,