[pmwiki-users] "No ending delimiter '!' found" messages after 2.0beta35 upgrade

Patrick R. Michaud pmichaud at pobox.com
Sat Apr 30 08:57:50 CDT 2005


On Sat, Apr 30, 2005 at 06:38:17PM +1200, Nate Cull wrote:
> I think I've found it:
> 
> pagelist.php, line 116:
> 
> foreach((array)@$opt['-'] as $i) { $exclp[] = '!'.preg_quote($i,
> '!').'/i'; }
> 
> I confess I have absolutely no idea what those '!'s are about, so if
> you're doing something especially cunning correct me - but aren't
> you just looking for a straight (true) text match, and then later (in
> line 151) rejecting any pages that match true for any of the exclude
> conditions?

I apparently got my exclude patterns wrong.  In other places PmWiki
uses a leading '!' for the pattern (instead of '/') to indicate
a negative (exclude) match instead of a positive (include) one.

Of course, we already know this is an exclusive match because it's
going into the $exclp array, so either ! or / will work as long as
the corresponding close delimiter matches with either !i or /i .

So, changing the '!' to a '/' does fix things, and I'll have the
code corrected in beta36.  Thanks for catching this bug and pointing
out the fix!

(Actually, upon reflection I think I can optimize all of this
still further by joining the terms into a single pattern to be matched.
That would be very nice.)

Pm



More information about the pmwiki-users mailing list