mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/13832] Allow callables for matching bbcodes
PHPBB3-13832
This commit is contained in:
parent
1076b562dd
commit
8a5c0965d3
1 changed files with 8 additions and 1 deletions
|
@ -83,7 +83,14 @@ class bbcode_firstpass extends bbcode
|
|||
// it should not demand recompilation
|
||||
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']);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue