[pmwiki-devel] Search forms and FmtPageList()

Petko Yotov 5ko at 5ko.fr
Sat Sep 26 04:31:01 CDT 2009


On Saturday 26 September 2009 10:41:44 Hans wrote:
> Friday, September 25, 2009, 5:43:01 PM, Hans wrote:
> > But i think i discovered a bug in FmtPageList, or maybe a feature?
> > the code reads:
> >
> >  # Handle "group/" at the beginning of the form-submitted request
> >  if (preg_match("!^($GroupPattern(\\|$GroupPattern)*)?/!i", $rq, $match))
> > { ......
> > .....
> > Can we do without the 'i' modifier, or serves it a good purpose?

It serves to allow searches like pmwiki/ to list pages in groups PmWiki, 
Pmwiki, PMwiki and PMWiki, and  pmwiki/word to find word in all these groups.


> I like to propose to remove the 'i' modifier in this
> preg_match. This will allow input of 'Group/term'
> to use group 'Group', and input of 'group/term' to look for
> 'group/term'. 

PmWiki allows to search for literal "group/term" by simply quoting it, and it 
is written in the search-form and search-results page.

PmWiki also allows recipe authors to modify the submitted query string before 
it processes it, or they can use a different variable than $_REQUEST['q'] to 
build the one PmWiki will use, etc., etc., etc.

We need really good reasons to break an established behavior, existing for 
many years, so this one is not likely to be easy. But if users request it, a 
configuration variable can be added to control the case sensitivity of the 
group/term feature, or even the full RegExp, allowing you to disable it.

> The general search of arguments is case insensitive,
> so doing a case-sensitive match for a 'Group/' prefix is feasable and
> will act as a switch for this special searchbox feature.

I fear that this may become too complex for normal users (not hardcore like 
us), to learn and operate. Fulltext search (for words and -words) is case 
insensitive.


> And it would mean that for a search extension recipe like TextExtract
> the special input feature of 'Group/term' can remain.
> I would prefer that over a disabling, since one can use TextExtract
> from within the standard searchbox by adding fmt=extract,
> so user may expect standard behaviour when entering 'Group/term'.

:-)) A user who is so advanced that she uses the fmt=extract parameter in a 
regular search form, I'm sure she already knows how to quote literal 
"group/word".

Thanks,
Petko



More information about the pmwiki-devel mailing list