PDA

View Full Version : [Not a bug] v2.2.6 Minimum size for search by username hardcoded


Paul
Sat 20th Jul '02, 3:15am
I did a search and didn't see this mentioned anywhere.

In search.php:


if ($searchuser!="" and strlen($searchuser)<=3 and $exactname!="yes") {


should be:


if ($searchuser!="" and strlen($searchuser)<=$minuserlength and $exactname!="yes") {


Assuming of course you have a minuserlength of less than three. This would be a problem if minuserlength were set to say 7 yet you wanted to search for all username matches to "apple".

Perhaps some logic where if $minuserlength is less than 3, then use that value instead.


if ($minuserlength <= 3) {
$searchminuserlength = $minuserlength; }
else {
$searchminuserlength = 3; }


and change $minuserlength above to $searchminuserlength.

Paul

Paul
Sun 21st Jul '02, 2:23am
Has this been confirmed as a bug? Or is it intended behavior?

eva2000
Sun 21st Jul '02, 3:09am
moving for verification by devs :)

Mike Sullivan
Sun 21st Jul '02, 11:53am
Actually, it was intended behavior. It only gets hit when doing "fuzzy matches", and it was to prevent someone from searching for "e" and returning A LOT of posts/users.

Paul
Thu 25th Jul '02, 12:56pm
Perhaps the limit should be clarified in the template then.

Reverting fix.