Skip to content
Snippets Groups Projects
Commit 5f99851e authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

remove bogus third matching group handling, fixes #2060

Closes #2060

Merge request studip/studip!1340
parent 279e54db
No related branches found
No related tags found
No related merge requests found
......@@ -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];
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment