Title: preg_replace /e modifier
Last modified: June 20, 2017

---

# preg_replace /e modifier

 *  Resolved [rag10](https://wordpress.org/support/users/rag10/)
 * (@rag10)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/preg_replace-e-modifier/)
 * When the excludeheading setting is enabled, PrettyLink uses the /e modifier of
   the preg_replace function. As this modifier has been deprecated since PHP version
   5.5.0 and removed in 7.0.0, all instances where the modifier is used, should 
   be replaced with the preg_replace_callback function.
 * I.e.
    `$text = preg_replace('%(<h.*?>)(.*?)(</h.*?>)%sie', "'$1'.insertspecialchars('
   $2').'$3'", $text);`
 * should be replaced by something like
 *     ```
       $text = preg_replace_callback('%(<h.*?>)(.*?)(</h.*?>)%si', function($matches) {
           return $matches[1] . insertspecialchars($matches[2]) . $matches[3];
       }, $text);
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [cartpauj](https://wordpress.org/support/users/cartpauj/)
 * (@cartpauj)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/preg_replace-e-modifier/#post-9245631)
 * Can you point me to a file and line number where Pretty Link is using the `/e`
   modifier? Before I mention this to the developer, I need to be able to prove 
   it’s a problem. But I cannot find anywhere that we’re using the `/e` modifier
   in our regex.

Viewing 1 replies (of 1 total)

The topic ‘preg_replace /e modifier’ is closed to new replies.

 * ![](https://ps.w.org/pretty-link/assets/icon-256x256.png?rev=2503434)
 * [PrettyLinks - Affiliate Links, Link Branding, Link Tracking, Marketing and Stripe Payments Plugin](https://wordpress.org/plugins/pretty-link/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pretty-link/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pretty-link/)
 * [Active Topics](https://wordpress.org/support/plugin/pretty-link/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pretty-link/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pretty-link/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [cartpauj](https://wordpress.org/support/users/cartpauj/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/preg_replace-e-modifier/#post-9245631)
 * Status: resolved