diff options
author | friendica <info@friendica.com> | 2012-04-01 03:19:37 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-04-01 03:19:37 -0700 |
commit | f0b8d016154e274f5bfe4d3ec5ac3950621cc2ce (patch) | |
tree | 7a4f26773f74b1a92d201a9804129f8a5fd99e27 /include | |
parent | ae5e5bf1e4695efdcc0f4fe1aa6c99a77a837612 (diff) | |
download | volse-hubzilla-f0b8d016154e274f5bfe4d3ec5ac3950621cc2ce.tar.gz volse-hubzilla-f0b8d016154e274f5bfe4d3ec5ac3950621cc2ce.tar.bz2 volse-hubzilla-f0b8d016154e274f5bfe4d3ec5ac3950621cc2ce.zip |
try slightly better detection of html in feeds
Diffstat (limited to 'include')
-rwxr-xr-x | include/items.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/items.php b/include/items.php index 9f7eb84d9..e09b888ca 100755 --- a/include/items.php +++ b/include/items.php @@ -416,7 +416,7 @@ function get_atom_elements($feed,$item) { // the wild, by sanitising it and converting supported tags to bbcode before we rip out any remaining // html. - if((strpos($res['body'],'<') !== false) || (strpos($res['body'],'>') !== false)) { + if((strpos($res['body'],'<') !== false) && (strpos($res['body'],'>') !== false)) { $res['body'] = reltoabs($res['body'],$base_url); @@ -429,13 +429,14 @@ function get_atom_elements($feed,$item) { // we shouldn't need a whitelist, because the bbcode converter // will strip out any unsupported tags. - // $config->set('HTML.Allowed', 'p,b,a[href],i'); $purifier = new HTMLPurifier($config); $res['body'] = $purifier->purify($res['body']); - $res['body'] = html2bbcode($res['body']); + $res['body'] = @html2bbcode($res['body']); } + else + $res['body'] = escape_tags($res['body']); $allow = $item->get_item_tags(NAMESPACE_DFRN,'comment-allow'); if($allow && $allow[0]['data'] == 1) |