From 43e3b146723ca7c3474ad49482c0096f49b2374c Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 13 Jan 2020 15:37:46 +0000 Subject: [PATCH] Tags and mentions should be escaped --- src/Model/Term.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Model/Term.php b/src/Model/Term.php index 2f8da0fac2..669d2167c7 100644 --- a/src/Model/Term.php +++ b/src/Model/Term.php @@ -447,13 +447,13 @@ class Term $item['body'] = str_replace($orig_tag, $tag['url'], $item['body']); } - $return['hashtags'][] = $prefix . '' . $tag['term'] . ''; - $return['tags'][] = $prefix . '' . $tag['term'] . ''; + $return['hashtags'][] = $prefix . '' . htmlspecialchars($tag['term']) . ''; + $return['tags'][] = $prefix . '' . htmlspecialchars($tag['term']) . ''; break; case self::MENTION: $tag['url'] = Contact::magicLink($tag['url']); - $return['mentions'][] = $prefix . '' . $tag['term'] . ''; - $return['tags'][] = $prefix . '' . $tag['term'] . ''; + $return['mentions'][] = $prefix . '' . htmlspecialchars($tag['term']) . ''; + $return['tags'][] = $prefix . '' . htmlspecialchars($tag['term']) . ''; break; case self::IMPLICIT_MENTION: $return['implicit_mentions'][] = $prefix . $tag['term']; -- 2.39.5