Fixes #4819 replace `preg_replace` with /e modifier with preg_replace_callback

This PR amends https://github.com/kohana/core/pull/456 with the suggestion by @shadowhand