From: Andrew Dolgov Date: Thu, 11 Nov 2010 06:52:19 +0000 (+0300) Subject: sanitize_rss: properly handle empty input X-Git-Tag: 1.5.0~297 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=96811a55e61ec9360782b24c9e630a61666618db;p=tt-rss.git sanitize_rss: properly handle empty input --- diff --git a/functions.php b/functions.php index cd6fafd1..d5852bde 100644 --- a/functions.php +++ b/functions.php @@ -3707,10 +3707,10 @@ function sanitize_rss($link, $str, $force_strip_tags = false, $owner = false, $site_url = false) { - $res = $str; - if (!$owner) $owner = $_SESSION["uid"]; + $res = trim($str); if (!$res) return ''; + if (get_pref($link, "STRIP_UNSAFE_TAGS", $owner) || $force_strip_tags) { // $res = strip_tags_long($res, @@ -3729,6 +3729,8 @@ '; + $res = trim($res); if (!$res) return ''; + libxml_use_internal_errors(true); $doc = new DOMDocument();