I just found a really odd bug in fuzzysearch by accident.

When I search for the word "test" on my website, I receive this message

warning: preg_replace() [function.preg-replace]: Unknown modifier ')' in /home/sites/penguintutorials.com/public_html/sites/all/modules/fuzzysearch/fuzzysearch.module on line 1125.
warning: preg_replace() [function.preg-replace]: Unknown modifier ')' in /home/sites/penguintutorials.com/public_html/sites/all/modules/fuzzysearch/fuzzysearch.module on line 1125.
warning: preg_replace() [function.preg-replace]: Unknown modifier ')' in /home/sites/penguintutorials.com/public_html/sites/all/modules/fuzzysearch/fuzzysearch.module on line 1125.

I haven't had time to play with it much. I will write back if I discover more.

Comments

Sepero’s picture

I at line 1125 I inserted this print in fuzzysearch.module to see if you can decipher the problem

print_r(array('/', $boundary, '[^', PREG_CLASS_SEARCH_EXCLUDE, PREG_CLASS_CJK, ']*', '(', implode('|', $clean_words), ')', '[^', PREG_CLASS_SEARCH_EXCLUDE, PREG_CLASS_CJK, ']*', $boundary, '/iu', '<strong>\0</strong>', $newbody));

Here is the output: (expires 04 Sept 2012)
http://xna.pastebin.ca/2079795

Sepero’s picture

Also getting the same errors from searching 'atest'. I'm assuming it is somehow related to when this line in the module is executed-
implode('|', $clean_words) = 'latest/'

Sepero’s picture

Priority: Minor » Normal

I would like to upgrade this bug from minor to normal now.
It appears that the bug also appears when searching for anything ending in est or test (ie. best, fastest, brightest)

The error is causing the module not to close all ending div brackets, and it returns a page with the styles malformed in the browser.

awolfey’s picture

Hi, sorry for the delay. Could you try this on dev? (Please back up or use a test site.) If the problem still exists, send me the node or a link to where I can see the problem.

I tried to duplicate it on the dev version but couldn't get it to happen. Thanks.