[Pmwiki-users] Search sometimes complains loudly

Patrick R. Michaud pmichaud at sci.tamucc.edu
Mon May 5 01:18:18 CDT 2003


I think that changing line 35 from

    preg_match('/^([-+]?)([\'"]?)(.*?)\\2$/',$t,$match);

to 

    preg_match('/^([-+]?)([\'"]?)(.+?)\\2$/',$t,$match);

ought to be a reasonable fix.  This forces the search term itself
to have at least one character, stealing it from the [-+] if necessary.
Thus

	apple -pancakes		"apple" but not "pancakes"
	apple - pancakes	"apple", "-", and "pancakes"
	apple + pancakes	"apple", "+", and "pancakes"

I have it this way on pmichaud.com at the moment, and if you concur
with the fix then it'll be in the next release.

Pm


On Mon, May 05, 2003 at 09:06:05AM +1200, John Rankin wrote:
> If one enters apple - pancakes instead of apple -pancakes then pmwiki gives a most robust response.
> 
> I patched HandleSearch to preg_replace '[-+]\s*' with '[-+]' but that has the side effect of changing phrase searches such as "world + dog" to "world +dog" so it probably needs a proper fix.
> 
> Otherwise search is working well.
> -- 
> John Rankin
> 
> 
> 
> 
> 
> _______________________________________________
> Pmwiki-users mailing list
> Pmwiki-users at pmichaud.com
> http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com
> 




More information about the pmwiki-users mailing list