From: Andrew Dolgov Date: Sun, 16 Oct 2005 14:48:33 +0000 (+0100) Subject: fix some brackets issues in feed editor X-Git-Tag: 1.0.7~46 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=6e0584e9308e0dc0049d2d59d2b0c86f619720b0;p=tt-rss.git fix some brackets issues in feed editor --- diff --git a/backend.php b/backend.php index 419d1b98..41b2c29d 100644 --- a/backend.php +++ b/backend.php @@ -806,15 +806,18 @@ } print "$feed_icon"; + $edit_title = htmlspecialchars(db_unescape_string($line["title"])); + $edit_link = htmlspecialchars(db_unescape_string($line["feed_url"])); + if (!$edit_feed_id || $subop != "edit") { print ""; print "" . - $line["title"] . ""; + $edit_title . ""; print "" . - $line["feed_url"] . ""; + $edit_link . ""; if ($line["update_interval"] == "0") $line["update_interval"] = "Default"; @@ -827,8 +830,8 @@ print ""; - print "".$line["title"].""; - print "".$line["feed_url"].""; + print "$edit_title"; + print "$edit_link"; if ($line["update_interval"] == "0") $line["update_interval"] = "Default"; @@ -839,8 +842,8 @@ print ""; - print ""; - print ""; + print ""; + print ""; print ""; } diff --git a/db.php b/db.php index c72bbd9d..e4673f67 100644 --- a/db.php +++ b/db.php @@ -103,6 +103,12 @@ function db_fetch_result($result, $row, $param) { } } +function db_unescape_string($str) { + $tmp = str_replace("\\\"", "\"", $str); + $tmp = str_replace("\\'", "'", $tmp); + return $tmp; +} + function db_close($link) { if (DB_TYPE == "pgsql") { diff --git a/opml.php b/opml.php index bcfa3170..2e87c037 100644 --- a/opml.php +++ b/opml.php @@ -24,8 +24,8 @@ $result = db_query($link, "SELECT * FROM ttrss_feeds ORDER BY title"); while ($line = db_fetch_assoc($result)) { - $title = $line["title"]; - $url = $line["feed_url"]; + $title = htmlspecialchars($line["title"]); + $url = htmlspecialchars($line["feed_url"]); print ""; }