aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-11-06 16:14:57 +0100
committerMax Kostikov <max@kostikov.co>2019-11-06 16:14:57 +0100
commitf8955f90b88f296f5d1cadd575d0fc4f90b85b82 (patch)
treeba0ec87b7c9f00b45f61b0dcac8fc2f4776bfb3b
parent9248fc96b3c7f79fa443262e3291f43b192908e4 (diff)
downloadvolse-hubzilla-f8955f90b88f296f5d1cadd575d0fc4f90b85b82.tar.gz
volse-hubzilla-f8955f90b88f296f5d1cadd575d0fc4f90b85b82.tar.bz2
volse-hubzilla-f8955f90b88f296f5d1cadd575d0fc4f90b85b82.zip
Move title sanitizer code in the right place
-rw-r--r--include/feedutils.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/feedutils.php b/include/feedutils.php
index f47afc7af..9f4d732bb 100644
--- a/include/feedutils.php
+++ b/include/feedutils.php
@@ -436,18 +436,6 @@ function get_atom_elements($feed, $item) {
if($summary === $res['body'])
$summary = '';
- else {
- $res['title'] = bbcode($res['title'], [ 'tryoembed' => false ]);
- $res['title'] = html2plain($res['title'], 0, true);
- $res['title'] = html_entity_decode($res['title'], ENT_QUOTES, 'UTF-8');
- $res['title'] = preg_replace("/https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@]+/", "", $res['title']);
- while (strpos($res['title'], "\n") !== false)
- $res['title'] = str_replace("\n", " ", $res['title']);
- while (strpos($res['title'], " ") !== false)
- $res['title'] = str_replace(" ", " ", $res['title']);
- $res['title'] = trim($res['title']);
- }
-
if(($summary) && ((strpos($summary,'<') !== false) || (strpos($summary,'>') !== false))) {
$summary = purify_html($summary);
@@ -461,6 +449,18 @@ function get_atom_elements($feed, $item) {
if (title_is_body($res['title'], $res['body']))
$res['title'] = "";
+ else {
+ $res['title'] = bbcode($res['title'], [ 'tryoembed' => false ]);
+ $res['title'] = html2plain($res['title'], 0, true);
+ $res['title'] = html_entity_decode($res['title'], ENT_QUOTES, 'UTF-8');
+ $res['title'] = preg_replace("/https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@]+/", "", $res['title']);
+ while (strpos($res['title'], "\n") !== false)
+ $res['title'] = str_replace("\n", " ", $res['title']);
+ while (strpos($res['title'], " ") !== false)
+ $res['title'] = str_replace(" ", " ", $res['title']);
+ $res['title'] = trim($res['title']);
+ }
+
if($res['plink'])
$base_url = implode('/', array_slice(explode('/',$res['plink']),0,3));