Has anybody ever heard of something that would cause preg_replace() to abort when it has only replaced some (not all) of the occurrences?<br><br>For instance... (this is not the example that has problems - just an illustration)<br>
<br> preg_replace('/(a)/e', 'strtoupper($1)', 'asdfasdfasdfasdf');<br>
<br>I'm running into a situation where it is returning AsdfAsdfasdfasdf (without replacing all occurrences).<br><br>Obviously the example above does not replicate the problem. The function in the replacement is actually in MarkupToHTML() in the rule for MarkupMarkup(). I've replicated it on 3 hosts (including <a href="http://pmwiki.org">pmwiki.org</a>).<br>
<br>It occurs when there is a (somewhat farfetched) edge condition -- I have a page Test.ThrottlePage with several thousand lines consisting of a numeric timestamp followed by a colon -- thus they are interpreted as PTVs:<br>
<br>12341234:<br>23452345:<br>34563456:<br><br>Then to reproduce the problem you must have 2 pagelists contained in (:markup:) each of which reference pagevars:<br><br>===========(snip)============<br>(:markup:) [=<br>(:pagelist group=Test wrap=inline hello:)<br>
=]<br><br>(:markup:) [=<br>(:pagelist group=Test wrap=inline $:Name=Page*:)<br>=]<br><br>(:markup:) [=<br>(:pagelist group=Test wrap=inline $:Author=*McQuilk*:)<br>=]<br>===========(snip)============<br><br>(As you can see I left a non-ptv pagelist at the top just for demonstration purposes.) The end result is that any (:markup:) blocks after the FIRST pagelist which contains a PTV reference remain un-processed. <br>
<br>It's easier to see than to describe:<br><br><a href="http://pmwiki.qdk.org/pmwiki.php/Test/PageList">http://pmwiki.qdk.org/pmwiki.php/Test/PageList</a><br><a href="http://pmwiki.org/wiki/Test/PageListA">http://pmwiki.org/wiki/Test/PageListA</a><br>
<br>I haven't played around with ThrottlePage to see how big it has to be in order to cross this threshold... Maybe it's far enough outside the norm that it doesn't even merit being addressed, but I'll tell you it was a *pain* tracking it down...<br>
<br>-Peter<br>