Thanks guys, I mentioned this recipe to Hans and he was kind enough to try and fix it, but it was way beyond my skills, actually quite advanced.
But it's a very good recipe and I look forward to having it fixed. :) Cheers, Philippe -----Original Message----- From: pmwiki-users [mailto:[email protected]] On Behalf Of Petko Yotov Sent: Wednesday, 10 December 2014 9:06 AM To: [email protected] Subject: Re: [pmwiki-users] attachtable for PHP 5.5 ? On 09.12.2014 22:47, Petko Yotov wrote: > This one is more advanced indeed, here is how to use it so that the > code is compatible with both PHP 5.5 and PHP 4. > > First, instead of preg_replace() with arguments arrays, we use the > built-in PPRA() function which will call intelligently preg_replace() > or preg_replace_callback() for every element of the arrays: > > if ($pg) $txt = preg_replace( # before > if ($pg) $txt = PPRA( # after Sorry, I forgot to mention that PPRA() expects the first argument to be an array with elements where the keys are search patterns and the values are the replacement strings or functions: array('/search/' => 'replace') so here we should make some more changes and rewrite this array, something like: PPRA( array( '/\[\[[^\]]*?\bAttach:([^"\]\|]*)/' => PCCF("return '[['.AttachtableCountUploadLinks('$pn','',\$m[1]);"), # etc. ), PHSC( $pg['text'], ENT_NOQUOTES ) ); Petko _______________________________________________ pmwiki-users mailing list [email protected] http://www.pmichaud.com/mailman/listinfo/pmwiki-users This message contains OPEN information that is not sensitive and can be freely accessed by people both inside and outside of the Thales Group This email was classified by Krait, Philippe on Wednesday, 10 December 2014 10:00:10 AM ------------------------------------------------------------------------- DISCLAIMER: This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted or transmitted without the written permission of the owner. If you have received this transmission in error, or are not an authorised recipient, please immediately notify the sender by return email, delete this message and all copies from your e-mail system, and destroy any printed copies. Receipt by anyone other than the intended recipient should not be deemed a waiver of any privilege or protection. Thales Australia does not warrant or represent that this e-mail or any documents, files and previous e-mail messages attached are error or virus free. ------------------------------------------------------------------------- _______________________________________________ pmwiki-users mailing list [email protected] http://www.pmichaud.com/mailman/listinfo/pmwiki-users
