Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Fizzy on November 29, 2003, 04:36:14 AM

Title: Search and usernames
Post by: Fizzy on November 29, 2003, 04:36:14 AM
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.
Title: Re: Search and usernames
Post by: [Unknown] on November 29, 2003, 04:01:27 PM
I think I just fixed this in the cvs, although I'm not sure... we'll see when I upload it.

-[Unknown]