You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In PHP 5.2, those back-references fall through as numerically keyed arrays.
A temporary work-around for PHP 5.2 users is to change the array keys to their expected numerical index, as shown below from Plugin.class.php, around line 124.
hmm, I would like to see that plugin having no greater requirements than wordpress, which has php 5.2 afair.
this would only lead to lots of negative reviews, since hosters don't always have the latest and greatest...
Activity
kkatpki commentedon Jun 17, 2013
I believe it has to do with the use of named back-references (https://github.com/oncletom/wp-less/search?q=%3FP%3C&ref=cmdform&type=Code) in preg_replace_callback, which is only supported in PHP 5.3 and above, from what I gather.
In PHP 5.2, those back-references fall through as numerically keyed arrays.
A temporary work-around for PHP 5.2 users is to change the array keys to their expected numerical index, as shown below from Plugin.class.php, around line 124.
Long-term, the plugin author should cite PHP 5.3 as the minimum requirement, or simply remove the named back-reference dependencies.
A reasonable compromise, without sacrificing too much readability, is to pull the regex match into local variables via list:
sebastianschmid commentedon Jun 17, 2013
hmm, I would like to see that plugin having no greater requirements than wordpress, which has php 5.2 afair.
this would only lead to lots of negative reviews, since hosters don't always have the latest and greatest...
thom4parisot commentedon Jun 18, 2013
Back-reference are available in PHP 5.2 — http://www.php.net/manual/en/regexp.reference.back-references.php
kkatpki commentedon Jun 18, 2013
@oncletom Yes, but it seems that named back-references were not allowed to propagate outside of the pattern until PHP 5.3.
kkatpki commentedon Jun 18, 2013
I've found a Stack Overflow answer that seems to reinforce the above assertion: http://stackoverflow.com/a/5255199
thom4parisot commentedon Jun 18, 2013
OK well, if it's the only blocking problem for PHP 5.2, I invite you to open a pull request with this change.
Thanks for coining the problem :-)
sebastianschmid commentedon Jun 18, 2013
pull request here: #39
thom4parisot commentedon Aug 6, 2013
I close the issue thanks to #39 and ship that in a new release (because I forgot to do it 2 months ago).