[pmwiki-users] Templates and PHP 7.x

Michael Eager eager at eagercon.com
Wed Nov 6 18:39:48 PST 2019

I'm trying to use the PmForm and Captcha Cookbook addons, which use the 
Template addon.  This fails because the Template code uses the 
deprecated /e extension to preg_replace:

	'>include',	## or where?
	"/($Parameters_mg|$Parameters_ms|$Parameters_mu)/e",    <====

	"/\(:template(.*?):\)/e",   <====

which eventually calls preg_replace(), not preg_replace_callback()
         if (is_callable($r)) $x = preg_replace_callback($p,$r,$x);
         else $x=preg_replace($p,$r,$x);   <====

I'm a bit confused by the code, but it looks to me that $r should be 
callable (which I suppose is the the callback function passed to 
Markup()), but preg_replace_callback() is not being called.

Is there a fix for this?

Michael Eager    eager at eagercon.com
1960 Park Blvd., Palo Alto, CA 94306

More information about the pmwiki-users mailing list