Browse Source

allow wordfilters to be callbacks

pull/40/head
Michael Foster 11 years ago
parent
commit
c6e629bf89
  1. 5
      inc/functions.php

5
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);
}

Loading…
Cancel
Save