Needs review
Project:
Fuzzy Search
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Mar 2012 at 19:37 UTC
Updated:
18 Mar 2014 at 13:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
JCB commentedI am getting the same error...
See below.
Type php
User Anonymous
Location http://www.sitename.co.za/fuzzysearch/results/voip%20OR%20phones?page=17
Referrer
Message preg_replace(): Unknown modifier ')' in /usr/www/users/bestdkutkr/sites/sitename.co.za/modules/fuzzysearch/fuzzysearch.module on line 1125.
Severity error
Not sure why this happens.
Here is the code located at this position
Let me know what you think...
Comment #2
Luisvsm commentedI found a fix.
For me it was being caused by parentheses not being escaped properly from the matched word list, then when the script goes and bolds words that were matched (line 1125) it falls over.
What I did to fix it was escape parentheses in the selected words before they're passed to the bolding function.
I'm not sure if there are more special characters that have neglected to be escaped, or if the words with parentheses will still be bolded as we actually hide the main text content on our search page for shorter page so I can't test it.
You could add more characters into the regex preg replace if it's getting tripped up by more than just parentheses.
Comment #3
mgiffordSo I was actually experiencing this in D6, but this fix still seems relevant in D7. Here's a patch against the git repo.