sanitize_rss: properly handle empty input
This commit is contained in:
parent
923818fc8d
commit
96811a55e6
|
@ -3707,10 +3707,10 @@
|
||||||
|
|
||||||
function sanitize_rss($link, $str, $force_strip_tags = false, $owner = false, $site_url = false) {
|
function sanitize_rss($link, $str, $force_strip_tags = false, $owner = false, $site_url = false) {
|
||||||
|
|
||||||
$res = $str;
|
|
||||||
|
|
||||||
if (!$owner) $owner = $_SESSION["uid"];
|
if (!$owner) $owner = $_SESSION["uid"];
|
||||||
|
|
||||||
|
$res = trim($str); if (!$res) return '';
|
||||||
|
|
||||||
if (get_pref($link, "STRIP_UNSAFE_TAGS", $owner) || $force_strip_tags) {
|
if (get_pref($link, "STRIP_UNSAFE_TAGS", $owner) || $force_strip_tags) {
|
||||||
|
|
||||||
// $res = strip_tags_long($res,
|
// $res = strip_tags_long($res,
|
||||||
|
@ -3729,6 +3729,8 @@
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||||
</head>';
|
</head>';
|
||||||
|
|
||||||
|
$res = trim($res); if (!$res) return '';
|
||||||
|
|
||||||
libxml_use_internal_errors(true);
|
libxml_use_internal_errors(true);
|
||||||
|
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
|
|
Loading…
Reference in New Issue