Search Moudule 1.1: Trailing Whitespace Search Error

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
jimbabwe
Forum Members
Forum Members
Posts: 29
Joined: Sat Nov 18, 2006 8:09 pm

Search Moudule 1.1: Trailing Whitespace Search Error

Post by jimbabwe »

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.
Last edited by jimbabwe on Wed Jan 31, 2007 11:14 am, edited 1 time in total.
jimbabwe
Forum Members
Forum Members
Posts: 29
Joined: Sat Nov 18, 2006 8:09 pm

Re: Search Moudule 1.1: Trailing Whitespace Search Error: A Solution...

Post by jimbabwe »

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.
Post Reply

Return to “CMSMS Core”