News:

Wondering if this will always be free?  See why free is better.

Main Menu

Search and usernames

Started by Fizzy, November 29, 2003, 04:36:14 AM

Previous topic - Next topic

Fizzy

This is a recent problem I had brought to my attention on my YaBBSE board and having tested it here we have exactly the same problem with SMF.

Carry out a search for a word when entering a username in the "by user" box and select "search for topics posted by someone"
If the username has a space in it (eg James Woodcock) , you will get a zero result even though a search without quoting a username brings up the right result.

I had to amend my YaBBSE search.php on a single line to get it working at home


   $userspec = trim($userspec);
   $userspec = preg_replace("/[^0-9A-Za-z#%+,-\.@^_]/", "", $userspec);


modify to

   $userspec = trim($userspec);
   $userspec = preg_replace("/ [^0-9A-Za-z#%+,-\.@^_]/", "", $userspec);


Spot the "space" added after the slash in the preg_replace.
I haven't found any problems in running search with the space added.
"Reality is merely an illusion, albeit a very persistent one." - A.E.


[Unknown]

I think I just fixed this in the cvs, although I'm not sure... we'll see when I upload it.

-[Unknown]

Advertisement: