[pmwiki-users] pmwiki and Xampp

Petko Yotov 5ko at 5ko.fr
Thu Dec 13 13:08:44 PST 2018


[Resending to the list, my e-mail client didn't reply as I expected.]

PmWiki and MarkupToHTML() work fine for me, I've been using both PHP 7.2 
and 7.3 since the day they became available.

The page I suggested explains that MarkupToHTML() processes custom 
Markup rules added by addons. Some of your addons have rules that worked 
before PHP 5.5 or 7.2, they don't appear to work anymore.

Please try it -- disable all addons and skins, and report if you see any 
warnings. Then:

1. Enable one addon (get its most recent version). If there are 
warnings, it needs work: disable the addon.

2. If you have more addons you haven't tested, go back to 1.

3. Please report which addons cause warnings, and we'll update them.

This is written in the Troubleshooting page I linked first, if it is not 
clear enough tell us and we'll work on the page.

Petko

P.S. Please make sure you updated pmwiki.php and all files in the 
scripts/ directory with their latest version (sometimes it happens that 
one or more of these files was not updated for some reason).

P.S. You should never need to modify PmWiki core files, everything is 
designed to be configurable and switchable so you don't lose your 
changes when you upgrade. If you have any difficulty please contact us.


On 13/12/2018 21:33, Mikelis, James wrote:
> The main offender is in function MarkupToHTML in pmwiki.php. I tried
> to convert it but cannot get it to work. I don't think this is an
> addon.
> 
> I upgraded to the latest wiki and it works ok on php 5.4, but not the
> latest PHP 7.2.12.
> 
> See below. Any help converting the function would be appreciated.
> 
> 
> 
> function MarkupToHTML($pagename, $text, $opt = NULL) {
> 
>   # convert wiki markup text to HTML output
> 
>   global $MarkupRules, $MarkupFrame, $MarkupFrameBase, $WikiWordCount,
> 
>     $K0, $K1, $RedoMarkupLine, $MarkupToHTML;
> 
>   $MarkupToHTML['pagename'] = $pagename;
> 
>   StopWatch('MarkupToHTML begin');
> 
>   array_unshift($MarkupFrame, array_merge($MarkupFrameBase, 
> (array)$opt));
> 
>   $MarkupFrame[0]['wwcount'] = $WikiWordCount;
> 
>   foreach((array)$text as $l)
> 
>     $lines[] = $MarkupFrame[0]['escape'] ? PVSE($l) : $l;
> 
>   $lines[] = '(:closeall:)';
> 
>   $out = '';
> 
>   while (count($lines)>0) {
> 
>     $x = array_shift($lines);
> 
>     $RedoMarkupLine=0;
> 
>     $markrules = BuildMarkupRules();
> 
>     foreach($markrules as $p=>$r) {
> 
>       list($r, $id) = (array)$r;
> 
>       $MarkupToHTML['markupid'] = $id;
> 
>       if ($p{0} == '/') {
> 
>         if (is_callable($r)) $x = preg_replace_callback($p,$r,$x);
> 
> 
> 
>       else $x=preg_replace($p,$r,$x); <--************
> 
> 
> 
>       }
> 
>                   elseif (strstr($x,$p)!==false) $x=eval($r);
> 
>       if (isset($php_errormsg))
> 
>         { echo "ERROR: pat=$p $php_errormsg"; unset($php_errormsg); }
> 
>       if ($RedoMarkupLine) { $lines=array_merge((array)$x,$lines); 
> continue 2; }
> 
>     }
> 
> 
> 
> James Mikelis
> 
> Principal  Technical Analyst | Staples Digital Solutions
> 
> Ph: 508.253.2016 * Fx: 508.253.7066 * 500 Staples Drive, Framingham, MA 
> 01702
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Petko Yotov <5ko at 5ko.fr>
> Sent: Thursday, December 13, 2018 3:13 PM
> To: Mikelis, James <James.Mikelis at Staples.com>
> Subject: Re: [pmwiki-users] pmwiki and Xampp
> 
> 
> 
> See the page
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.pmwiki.org%2FTroubleshooting&data=01%7C01%7CJames.Mikelis%40staples.com%7Cd571153d7eb34b25a77b08d661376e50%7Cb101f7ab56ac485fb3975279698fdf7d%7C1&sdata=jwrgsei5PyfZ1wkVWacRDgB%2FcSfw%2FwAR9oHi3ZYCdt8%3D&reserved=0
> 
> 
> 
> Basically,
> 
> * disable all skins and addons,
> 
> * upgrade to the most recent PmWiki version (read release notes),
> 
> * get the most recent version of every addon/recipe/module/skin you
> use (read release notes),
> 
> * enable the addons one after another to see what works.
> 
> 
> 
> If you have any difficulty please report. We are in the process of
> fixing all addons for PHP 7, if you need some that are not fixed we'll
> do them first. I already see in your warnings csstooltipstogo and
> attachdel, if you need those and others we'll update them.
> 
> 
> 
> Petko
> 
> 
> 
> --
> 
> If you upgrade :
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.pmwiki.org%2FUpgrades&data=01%7C01%7CJames.Mikelis%40staples.com%7Cd571153d7eb34b25a77b08d661376e50%7Cb101f7ab56ac485fb3975279698fdf7d%7C1&sdata=pyKG4oU6QKniuxMB%2BO46ii3n7BMJwL0xH3M2hKnaaiU%3D&reserved=0
> 
> 
> 
> 
> 
> On 13/12/2018 18:00, Mikelis, James wrote:
> 
>> I recently upgraded to the latest version of pmwiki I have running on
> 
>> a 5-year-old version of XAMPP.
> 
>> All worked fine until I tried installing the latest version of XAMPP
> 
>> because of PHP security holes in the old version XAMPP was running.
> 
>> However, the latest XAMPP containing PHP 7.* breaks my pmwiki with
> 
>> several errors during startup.
> 
>> 
> 
>> What can I do to resolve them? What is the supported version of PHP
> 
>> pmwiki runs on?  I am not sure what the below errors mean or how to
> 
>> fix them. Help would be appreciated. I get more than 100 of them
> 
>> during startup and my wiki does not work.
> 
>> Thanks. James
> 
>> 
> 
>> Deprecated: The each() function is deprecated. This message will be
> 
>> suppressed on further calls in
> 
>> C:\xampp\htdocs\pmwiki\cookbook\csstooltipstogo.php on line 93
> 
>> 
> 
>> Warning: preg_replace(): The /e modifier is no longer supported, use
> 
>> preg_replace_callback instead in C:\xampp\htdocs\pmwiki\pmwiki.php on
> 
>> line 1777
> 
>> 
> 
>> Warning: Cannot modify header information - headers already sent by
> 
>> (output started at C:\xampp\htdocs\pmwiki\pmwiki.php:1777) in
> 
>> C:\xampp\htdocs\pmwiki\pmwiki.php on line 1304
> 
>> 
> 
>> Warning: Use of undefined constant ATTACH_DELETE_VERSION - assumed
> 
>> 'ATTACH_DELETE_VERSION' (this will throw an Error in a future version
> 
>> of PHP) in C:\xampp\htdocs\pmwiki\cookbook\attachdel.php on line 34



More information about the pmwiki-users mailing list