[bug] Specific Search does not find content

Please report bugs here!

Moderator: Thorsten

Post Reply
IHaveYourMilk
Posts: 13
Joined: Sun May 19, 2013 8:16 am

[bug] Specific Search does not find content

Post by IHaveYourMilk » Mon Jul 08, 2013 11:19 am

Hello,

I have an Hebrew version of phpMyFAQ installed and it is great,

when i was testing, i noticed some very straight forward queries has not returned the right results..

i debugged and found the following :

1. the issue resides only with MySQL and MySQLi
2. only happen when some specific letters are in the search term.

i nested further, and found the code that cause this:

Lines 66-68 @ ./inc/PMF/Search/Database/MySql.php
and
Lines 66-68 @ ./inc/PMF/Search/Database/MySqli.php

Code: Select all

            $chars      = array (chr(150), chr(147), chr(148), chr(146), chr(34), '"', '"');
            $replace    = array ("-", "\"", "\"", "'", "\"" , "\"", "\"");       
            $searchTerm = str_replace ($chars, $replace, $searchTerm);
additional note: chr(146), chr(147), chr(148) & chr(150) are a letter in hebrew language, and might be in other languages too.

What are these replacements for? what happens when i remove them?

Thank you very much
"If you build it, it will come..."

Thorsten
Posts: 14809
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: [bug] Specific Search does not find content

Post by Thorsten » Mon Jul 08, 2013 3:50 pm

Hi,

these unicode characters are controlling characters which could break the SQL query, that's why we replace them. If you have issues with these characters it might be an encoding issue on your side.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

IHaveYourMilk
Posts: 13
Joined: Sun May 19, 2013 8:16 am

Re: [bug] Specific Search does not find content

Post by IHaveYourMilk » Tue Jul 09, 2013 6:30 am

Hey,

over my league i think,
i'll leave the first 4 off,
if MSSQL dont need it, MySQL will get used to it :)

at least untill i will debug this thing.
"If you build it, it will come..."

Post Reply