]> git.koha-community.org Git - koha.git/commit
Bug 10131: Add a fallback if the pref search is not a valid regex
authorJonathan Druart <jonathan.druart@biblibre.com>
Tue, 14 Apr 2015 11:45:14 +0000 (13:45 +0200)
committerChris Cormack <chris@bigballofwax.co.nz>
Wed, 22 Apr 2015 05:52:00 +0000 (17:52 +1200)
commit02f7d6a4731cd58cb9653755acab8d9af6eb4542
treee4797798e2b6153ca6598eee6350a341bbec3cd5
parent40ad305c8e2014aaf832d44f0c5f5229ad979818
Bug 10131: Add a fallback if the pref search is not a valid regex

It's possible to search prefs using a regex.
But it the regex is not correctly written, the app explodes.
We should provide a fallback.

Test plan:
0/ Does not apply the patch
1/ Search for sysprefs with "notes.*", note the number of results
2/ Search for *notes*, boom
3/ Apply the patch
4/ Repeat 1 and confirm you get the same number of results
5/ Repeat 2 and confirm you don't get the error anymore

NOTE: As noted on comment #4, the kaboom is because of the
      leading * and not the following *, because 's*' is a valid
      regular expression, while '*n' is not.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 65cb0f5be636a15387a3996c32da051d4114719e)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
admin/preferences.pl