Fix some preg_replace_callback calls, fixes #5761