I have managed to get my extension working with s9e, but am having difficulty getting the old method to work. I am beginning to think that it is broken. Does anyone know of a currently working extension that uses the "bbcode_second_pass_by_extension" method?
The problem that I have encountered is that the event 'core.bbcode_cache_init_end' is used to pass back a custom preg_replace callback function which gets added into the bbcode parsing array.
The phpBB source code gives the example:
Code: Select all
/**
* Function to perform custom bbcode second pass by extensions
* can be used to assign bbcode pattern replacement
* Example: '#\[list=([^\[]+):$uid\]#e' => "\$this->bbcode_second_pass_by_extension('\$1')"
*
* Accepts variable number of parameters
*
* @return mixed Second pass result
*/
Code: Select all
if (is_callable($preg['replace'][$key]))
{
$message = preg_replace_callback($search, $preg['replace'][$key], $message);
}
On my installation, (php7.1, phpBB3.2.3) the is_callable test fails if the callback function is specified with parameters, and the preg_replace_callback function fails if the callback function is specified without parameters.