replacing preg_replace with preg_replace_callback - issue #15