]> git.koha-community.org Git - koha.git/commit
Bug 12593: search facets die with regex error if biblio has square brackets in fields
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 17 Jul 2014 10:27:55 +0000 (12:27 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 18 Jul 2014 13:41:18 +0000 (10:41 -0300)
commit62a08be95b575f0cbc861f44505b06c42283d38c
treecd269614ac5a63807cd72f16227c5eee283097da
parentbbc0462a73407116ad9029f4555f6a2f4e817587
Bug 12593: search facets die with regex error if biblio has square brackets in fields

It's quite common to have [something] within facet data, and it produces following error:

Unmatched [ in regex; marked by <-- HERE in m/^[ <-- HERE

This problem was intoduced in Bug 12151 but is trivial to fix.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Good catch.

To test:
- Created a bibliographic record, linked to an authority record (personal name). Did a search that returned the author as a facet.
- Added a [ symbol to the author name.
- Repeated the search
=> FAIL: "Unmatched [ in regex; marked by <-- HERE in m/^[ <-- HERE"
- Apply the patch
- Retry the search
=> SUCCESS: No error, bracket shows correctly.

Passes koha-qa.pl too.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Search.pm