diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-13 01:53:23 +1000 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-13 01:53:23 +1000 |
| commit | c6e629bf89b2b625f2f84ad73620f5a82b7a207e (patch) | |
| tree | ff35fa925575bc4613de2ea5683229e8c42b17ad /inc/functions.php | |
| parent | 60b3cfc539392d5b760244e21b69136895e938cb (diff) | |
allow wordfilters to be callbacks
Diffstat (limited to 'inc/functions.php')
| -rw-r--r-- | inc/functions.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/inc/functions.php b/inc/functions.php index 74ab96e9..848d9204 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1415,7 +1415,10 @@ function wordfilters(&$body) { foreach ($config['wordfilters'] as $filter) { if (isset($filter[2]) && $filter[2]) { - $body = preg_replace($filter[0], $filter[1], $body); + 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); } |
