Not sure if this has been encountered already, but if I use the built-in search module 1.1 to search terms from news articles and enter a single word with trailing whitespace, the results page has problems.
I'm working on a Russian site. If I eliminate the trailing whitespace, the results appear:
Search Results For "ООН"
* News - Центральноазиатские страны будут восстанавливать деградированные земли (100%)
If I search for the same term with trailing whitespace, there's a problem with the title of the new article and the results appear:
Search Results For "ООН "
* News - �������������������������������������� ������������ ���������� ������������������������������ ������������������������������ ���������� (100%)
The characters showing as little squares above actually appear as black diamonds with a question mark in the middle.
I've switched browser encoding options to try all cyrillic encodings to see whether this is the result of a charset, but no luck.
Any ideas?
Thanks in Advance.
Search Moudule 1.1: Trailing Whitespace Search Error
Search Moudule 1.1: Trailing Whitespace Search Error
Last edited by jimbabwe on Wed Jan 31, 2007 11:14 am, edited 1 time in total.
Re: Search Moudule 1.1: Trailing Whitespace Search Error: A Solution...
I added a line to the 'action.dosearch.php' in the Search directory that seems to have fixed my problem:
Line 7 of action.dosearch.php reads:
$params['searchinput'] = htmlspecialchars($params['searchinput']);
I added the following just below line 7:
$params['searchinput'] = chop($params['searchinput']);
Seems to work. I tested by adding 1, 2, 3, etc. whitespaces with no more errors in the search results.
Line 7 of action.dosearch.php reads:
$params['searchinput'] = htmlspecialchars($params['searchinput']);
I added the following just below line 7:
$params['searchinput'] = chop($params['searchinput']);
Seems to work. I tested by adding 1, 2, 3, etc. whitespaces with no more errors in the search results.

