This is not a critical one. But when I search with phrases highlight is just for $q['and'] elements which are separated words. I noticed $poswords is only for highlighting. So what I patched is...
1. Add not only unquoted CJK *words* but also unquoted latin words to phrases.
2. $poswords is replaced with $regex.
3. $_REQUEST['s'] become regular expression including parentheses.
4. Applied $regex to snippet and search highlighting.
I think patch files of bug 1191
and 1192 need be applied before these patch files.
- One thing I don't like is that this changes format of some functions' second argument, $poswords, though I guess the function is not called elsewhere---I grep searched source code and popular plugins.
- Another one I don't like is it changes the way _REQUEST['s'] is formed---from space separated words to regular expression. So this doesn't show proper highlight with previously saved urls.
- If compatibility about highlighting is a big issue, this can be achieved by adding $regex as optional argument and branch in the function and adding another field like _REQUEST['regexp']... but my patches are not doing this.
I'm just hoping these patches will be helpful.