Re: [pmwiki-users] Fix blogit for use with PHP 5.5

2014-11-01 Thread DaveG



On 11/1/2014 3:07 PM, Petko Yotov wrote:

I went
ahead and used anon functions with Markup, just to make things
internally consistent.


This is fine as long as your recipe is intended to only work with PHP
5.3 and more recent:

   http://php.net/manual/en/functions.anonymous.php
Ah, I was not aware of that. I'll update the wiki to make that clearer. 
In which case, I'll take the same approach as PmForm, and test for 
Markup_e, and use that, otherwise use the original behavior.




3. All: Any suggestions for this:
   $bodyTags = (preg_match_all('/\[\[\!(.*?)\]\]/e', $body, $match)
?$match[1] :array());

   To be honest I'm not entirely sure why the e modifier is used
there, but assuming it's needed, do we have Pm helper functions for
preg_match_all?


The "e" part should not be needed - it is ignored by preg_match_all().

Thanks.

Also, thanks to John, and Tiger!P -- your input is appreciated.


 ~ ~ David

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


Re: [pmwiki-users] Fix blogit for use with PHP 5.5

2014-11-01 Thread Petko Yotov

On 30.10.2014 22:41, DaveG wrote:

2. All: Is there a preference to using Markup_e over Markup?


No, simply Markup_e() should be easier (less code) in some cases which I 
assumed will be frequent.



I went
ahead and used anon functions with Markup, just to make things
internally consistent.


This is fine as long as your recipe is intended to only work with PHP 
5.3 and more recent:


  http://php.net/manual/en/functions.anonymous.php


3. All: Any suggestions for this:
   $bodyTags = (preg_match_all('/\[\[\!(.*?)\]\]/e', $body, $match)
?$match[1] :array());

   To be honest I'm not entirely sure why the e modifier is used
there, but assuming it's needed, do we have Pm helper functions for
preg_match_all?


The "e" part should not be needed - it is ignored by preg_match_all().

Petko


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users