mirror of
https://github.com/Circlepuller/Tinyboard.git
synced 2025-01-18 05:48:34 +01:00
allow wordfilters to be callbacks
This commit is contained in:
parent
60b3cfc539
commit
c6e629bf89
@ -1415,6 +1415,9 @@ function wordfilters(&$body) {
|
||||
|
||||
foreach ($config['wordfilters'] as $filter) {
|
||||
if (isset($filter[2]) && $filter[2]) {
|
||||
if (is_callable($filter[1]))
|
||||
$body = preg_replace_callback($filter[0], $filter[1], $body);
|
||||
else
|
||||
$body = preg_replace($filter[0], $filter[1], $body);
|
||||
} else {
|
||||
$body = str_ireplace($filter[0], $filter[1], $body);
|
||||
|
Loading…
x
Reference in New Issue
Block a user