LP#1373601: Consider relevant characters before using word-boundary checks
authorMike Rylander <mrylander@gmail.com>
Tue, 22 Mar 2016 15:50:58 +0000 (11:50 -0400)
committerKathy Lussier <klussier@masslnc.org>
Fri, 1 Apr 2016 20:32:35 +0000 (16:32 -0400)
commitde875779594720f9a405580c87e1d5754269e354
treecf02dd36429aaebb5ddfa3c2f86a099aa17dcd58
parent4c0b69dd7e170577b62b60f5b12d06b8a97f4585
LP#1373601: Consider relevant characters before using word-boundary checks

To perform unanchored phrase limits, we make sure that the phrase supplied
by the user does not end in the middle of a word by bounding the condition
with word-boundary bracket expresssions.  However, if the phrase starts
or ends with a non-word character (that is, something other than numbers,
letters, or the underscore) then the word-boundary expression won't match.
The effect of this is to cause phrase searches starting or ending in
punctuation to fail when the user would not expect them to.

To address this, we now test the phrase for word-iness at the front and
back before applying word-boundary bracket expressions.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm