<div class="gmail_quote">On Fri, Mar 27, 2009 at 1:32 PM, Petko Yotov <span dir="ltr"><<a href="mailto:5ko@5ko.fr">5ko@5ko.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Thursday 26 March 2009 17:31:02 Peter Bowers wrote:<br>
> preg_replace('/(a)/e', 'strtoupper($1)', 'asdfasdfasdfasdf');<br>
><br>
> I'm running into a situation where it is returning AsdfAsdfasdfasdf<br>
> (without replacing all occurrences).<br>
<br>
</div>I have experienced this when some other pattern has already processed and<br>
modified (or skipped) some of the occurrences. In PmWiki it might happen if<br>
the "when" parameter for Markup() is not correctly/optimally set.<br>
<div class="im"><br>
<br>
> (As you can see I left a non-ptv pagelist at the top just for demonstration<br>
> purposes.) The end result is that any (:markup:) blocks after the FIRST<br>
> pagelist which contains a PTV reference remain un-processed.<br>
><br>
> It's easier to see than to describe:<br>
<br>
</div>> <a href="http://pmwiki.org/wiki/Test/PageListA" target="_blank">http://pmwiki.org/wiki/Test/PageListA</a><br>
<br>
Right, there is a problem with more than two (:markup:)[=code=] although it<br>
doesn't seem to happen on other places like BasicEditing where it appears<br>
more than twice. We'll have to investigate further to find out why and how to<br>
fix it, but I suspect something messes with the $KPV array.<br>
<br>
Otherwise, using (:markup:)...(:markupend:) seems to work fine with more than<br>
two pagelists.<br>
</blockquote><div><br>Interesting that (:markup:)...(:markupend:) works fine.<br><br>If it helps at all I narrowed it down to needing about 3900 lines (each with a PTV def) in ThrottlePage before the problem disappeared. (Note that I still had 8-10 "(:markup:) [=...=]" markups and it worked without difficulty once the data on that page was more limited.) Around the 3900 mark the behavior started getting non-repeatable -- reloading the page 3-4 times would result in different results. To me this sounds like a memory problem and bumping into some limit in PHP (particularly since I have verified that the preg_replace() in MarkupToHTML() does *not* call the MarkupMarkup() function past the problem-markup -- in other words preg_replace() is not replacing all occurrences of the given pattern - something that to my knowledge should *never* happen.)<br>
<br>In any event, if anybody else is going to play with this please make a copy of the ThrottlePage -- I'm going to delete it since it will cause an unnecessary load on the server whenever it is accessed in a PTV context (i.e., a pagelist specifying any PTV condition which runs over the Test group)...<br>
<br>-Peter <br></div></div>