summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-11 09:52:19 +0300
committerAndrew Dolgov <[email protected]>2010-11-11 09:52:19 +0300
commit96811a55e61ec9360782b24c9e630a61666618db (patch)
treea4dc3bc381d0221d19cb7685dfadcefd564d66cd
parent923818fc8dac01f18b9ac269ab6dc10851774959 (diff)
sanitize_rss: properly handle empty input
-rw-r--r--functions.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/functions.php b/functions.php
index cd6fafd11..d5852bde1 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 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>';
+ $res = trim($res); if (!$res) return '';
+
libxml_use_internal_errors(true);
$doc = new DOMDocument();