01348: Flipbox bug
Description: The Flipbox cookbook http://www.pmwiki.org/wiki/Cookbook/Flipbox is spewing errors in the error log about
the /e modifier is deprecated,
A patch is below. I don't exactly understand the code in the patch, I just changed it to match patterns from other fixes and it's working for me. It makes some sense but I didn't track down all the transformations that are happening.
root@thealeph:/var/www/wiki/cookbook>diff -c cookbook/flipbox.php flipbox.php
*** cookbook/flipbox.php 2011-10-08 22:28:59.000000000 -0500
--- flipbox.php 2014-06-14 19:25:59.929066827 -0500
***************
*** 26,34 ****
SDV($QualifyPatterns["/\\[([$FlipboxChoices])\\]/"], '[$1$1$1]');
# I wish I could do this otherwise...
! Markup('flipbox_pre', '<[=', "/(\\[[$FlipboxChoices]{1,3})(\\])/e", "FmtPreFlipbox('$1', '$2')");
! Markup('flipbox', 'inline', "/\\[([$FlipboxChoices]{1,3})\t\t\t(\\d+)\t\t\t\\]/e",
! "FmtFlipbox(\$pagename,'$1','$2','$3')");
Markup('flipbox_post', '>restore', "/\\[([$FlipboxChoices]{1,3})\t\t\t\\d+\t\t\t\\]/", "[$1]");
function FmtPreFlipbox($_1, $_2) {
--- 26,35 ----
SDV($QualifyPatterns["/\\[([$FlipboxChoices])\\]/"], '[$1$1$1]');
# I wish I could do this otherwise...
! Markup_e('flipbox_pre', '<[=', "/(\\[[$FlipboxChoices]{1,3})(\\])/", "FmtPreFlipbox(\$m[1], \$m[2])");
! Markup_e('flipbox', 'inline', "/\\[([$FlipboxChoices]{1,3})\t\t\t(\\d+)\t\t\t\\]/",
! "FmtFlipbox(\$pagename,\$m[1],\$m[2],\$m[3])");
!
Markup('flipbox_post', '>restore', "/\\[([$FlipboxChoices]{1,3})\t\t\t\\d+\t\t\t\\]/", "[$1]");
function FmtPreFlipbox($_1, $_2) {
Gerry June 14, 2014, at 07:49 PM
Thanks, I'll update the recipe in the next 10 days. --Petko June 19, 2014, at 09:54 AM
Still not updated? Any chance we could get this included? Or are you recommending something other than Flipbox? I know; you are off to bigger and better things. :-)
Gerry - Fri Jan 2 09:58:36 CST 2015
Thanks for reminding me. I've released a version compatible with PHP 5.5, see Flipbox. --Petko January 02, 2015, at 10:34 AM