Replace a deprecated preg_replace call by preg_replace_callback