back-ported fix for deprecated /e modifier to preg_replace refs #889

This PR contains a back-ported fix for better compatability with PHP 5.5.

 | Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | 
| Refs tickets  | #889
| License       | MIT
| Doc PR        |