[pmwiki-devel] MatchPageNames

Hans design5 at softflow.co.uk
Tue May 22 17:02:18 CDT 2007


Tuesday, May 22, 2007, 10:17:44 PM, Patrick wrote:

>>    echo (boolean)MatchPageNames('Forum.Test1','-PmWiki.*,-Site.*');
>> 
>> will echo 1.
>> But the target page is not part of the pattern.

> Ummmm, yes it is.  The pattern says "all pages that are not
> in the PmWiki or Site groups", and since 'Forum.Test1' isn't
> in either of those groups, it matches the pattern.

> So MatchPageNames() is correctly returning 1 in this case,
> since exactly one page from the list ('Forum.Test1')
> matches the pattern '-PmWiki.*,-Site.*'.

This means that for this purpose of checking exactly one pagename
against a pattern of excluded and included page names, if no included
page names are in the pattern it means including all pages (except the
excluded pages).

  echo (boolean)MatchPageNames('Forum.Test','-PmWiki.*,-Site.*,Main.*');

will return nothing, but

  echo (boolean)MatchPageNames('Forum.Test','-PmWiki.*,-Site.*');

will return 1.

Hmmm, this is unexpected. It also means for Fox that to give a default
pattern of excluded pages only will allow Fox to post to all other
pages by default. Until one or more including patterns are added, and
then Fox will be restricted to post to pages matching these.
I would find it more logical if the absence of an inclusive pattern
means no match. How can I achieve that?


Hans




More information about the pmwiki-devel mailing list