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:31:30 +0000 (16:31 -0400)
commitb6f977f633b478e401874c898727a97acc31ba16
tree6ff0d6f28f489536a08914af56ca05c5416be24a
parent0846df01f4892211347c2f42b20a836b1e0ec138
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