Closed (fixed)
Project:
htmLawed
Version:
7.x-3.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
6 Dec 2017 at 19:07 UTC
Updated:
13 Dec 2017 at 13:51 UTC
Jump to comment: Most recent
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('<', '>', '&'), '$1'). \"?\x84\"", "\"\x83?php\". str_replace(array('<', '>', '&'), array('<', '>', '&'), '$1')"), $text);
}and
if (!empty($config['save_php'])) {
$text = preg_replace(array('`\x83\?php(.+?)\?\x84`sme', '`\x83\?php(.*)$`sme'), array("'<?php'. str_replace(array('&', '<', '>'), array('&', '<', '>'), '$1'). '?>'", "'<?php'. str_replace(array('&', '<', '>'), array('&', '<', '>'), '$1')"), $text);
}
Comments
Comment #2
darrell_ulm commentedComment #3
darrell_ulm commentedComment #4
alpha2zee commentedThank 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.
Comment #5
alpha2zee commentedComment #6
darrell_ulm commentedLooks good, thank you!