From c3a235242eb180860ac778743184d2297dd8f3a9 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 21 Dec 2023 10:19:26 +0000 Subject: do not double process quoted strings --- include/text.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/text.php') diff --git a/include/text.php b/include/text.php index 27dd94bc5..38a207c5d 100644 --- a/include/text.php +++ b/include/text.php @@ -904,6 +904,8 @@ function get_tags($s) { $ret[] = $mtch; } } + + if(preg_match_all('/([@#\!]\".*?\")/',$s,$match)) { foreach($match[1] as $mtch) { $ret[] = $mtch; @@ -936,6 +938,8 @@ function get_tags($s) { // or quote remnants from the quoted strings we already picked out earlier if(strpos($mtch,'"')) continue; + if(strpos($mtch,'"')) + continue; $ret[] = $mtch; } @@ -1639,6 +1643,7 @@ function format_hashtags(&$item) { $s = ''; $terms = isset($item['term']) ? get_terms_oftype($item['term'], array(TERM_HASHTAG, TERM_COMMUNITYTAG)) : []; + if($terms) { foreach($terms as $t) { $term = htmlspecialchars($t['term'], ENT_COMPAT, 'UTF-8', false) ; -- cgit v1.2.3