From 5f99851efe8fe1c9643c8b9c59492101369891d1 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Willms <tleilax+studip@gmail.com> Date: Tue, 24 Jan 2023 15:09:17 +0000 Subject: [PATCH] remove bogus third matching group handling, fixes #2060 Closes #2060 Merge request studip/studip!1340 --- lib/classes/SmileyFormat.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/classes/SmileyFormat.php b/lib/classes/SmileyFormat.php index e0a9034461b..21c13603c4c 100644 --- a/lib/classes/SmileyFormat.php +++ b/lib/classes/SmileyFormat.php @@ -14,7 +14,7 @@ class SmileyFormat extends TextFormat { const REGEXP = '(\>|^|\s):([_a-zA-Z][_a-z0-9A-Z-]*):(?=$|\<|\s)'; - function __construct() + public function __construct() { $rules = []; @@ -38,20 +38,20 @@ class SmileyFormat extends TextFormat /** * Smiley notation defined by name (:name:) */ - static function smiley($markup, $matches) + public static function smiley($markup, $matches) { - return $matches[1] . Smiley::getByName($matches[2])->getImageTag() . $matches[3]; + return $matches[1] . Smiley::getByName($matches[2])->getImageTag(); } /** * Smiley short notation as defined in database */ - static function short($markup, $matches) + public static function short($markup, $matches) { $smileys = Smiley::getShort(); $name = $smileys[$matches[2]] ?? ''; return $name - ? $matches[1] . Smiley::getByName($name)->getImageTag() . ($matches[3] ?? '') + ? $matches[1] . Smiley::getByName($name)->getImageTag() : $matches[0]; } } -- GitLab