On PHP 7.1

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in _htmLawed_process()

in htmLawed.module (not the imported library)

if $config['save_php'] is set these can throw the above error

 if (!empty($config['save_php'])) {
    $text = preg_replace(array('`<\?php(.+?)\?>`sme', '`<\?php(.*)$`sme'), array("\"\x83?php\". str_replace(array('<', '>', '&'), array('&lt;', '&gt;', '&amp;'), '$1'). \"?\x84\"", "\"\x83?php\". str_replace(array('<', '>', '&'), array('&lt;', '&gt;', '&amp;'), '$1')"), $text);
  }

and

  if (!empty($config['save_php'])) {
    $text = preg_replace(array('`\x83\?php(.+?)\?\x84`sme', '`\x83\?php(.*)$`sme'), array("'<?php'. str_replace(array('&amp;', '&lt;', '&gt;'), array('&', '<', '>'), '$1'). '?>'", "'<?php'. str_replace(array('&amp;', '&lt;', '&gt;'), array('&', '<', '>'), '$1')"), $text);
  }

Comments

darrell_ulm created an issue. See original summary.

darrell_ulm’s picture

Issue summary: View changes
darrell_ulm’s picture

Title: Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in _htmLawed_process() » PHP 7.1 Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in _htmLawed_process()
Issue summary: View changes
alpha2zee’s picture

Assigned: Unassigned » alpha2zee
Status: Active » Fixed

Thank you for pointing this out. I have fixed the issue. The new releases of the modules (3.7 for D7 and 3.3 for D8) no longer use the 'preg_replace with e modifier' code.

alpha2zee’s picture

Status: Fixed » Closed (fixed)
darrell_ulm’s picture

Looks good, thank you!