mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-04 07:47:34 +02:00
[ticket/13832] Allow callables for matching bbcodes
PHPBB3-13832
This commit is contained in:
@@ -83,7 +83,14 @@ class bbcode_firstpass extends bbcode
|
|||||||
// it should not demand recompilation
|
// it should not demand recompilation
|
||||||
if (preg_match($regexp, $this->message))
|
if (preg_match($regexp, $this->message))
|
||||||
{
|
{
|
||||||
$this->message = preg_replace($regexp, $replacement, $this->message);
|
if (is_callable($replacement))
|
||||||
|
{
|
||||||
|
$this->message = preg_replace_callback($regexp, $replacement, $this->message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->message = preg_replace($regexp, $replacement, $this->message);
|
||||||
|
}
|
||||||
$bitfield->set($bbcode_data['bbcode_id']);
|
$bitfield->set($bbcode_data['bbcode_id']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user