Bug 12654 - Incorrect quoting in regexp in AuthoritiesMarc
Summary: Incorrect quoting in regexp in AuthoritiesMarc
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Authority data support (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Colin Campbell
QA Contact: Testopia
URL:
Keywords:
: 12364 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-07-24 16:01 UTC by Colin Campbell
Modified: 2015-12-03 22:11 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Proposed patch (1.22 KB, patch)
2014-07-24 16:21 UTC, Colin Campbell
Details | Diff | Splinter Review
Bug 12654 Correct incorrectly quoted regexp (1.27 KB, patch)
2014-07-29 07:01 UTC, Chris Cormack
Details | Diff | Splinter Review
[PASSED QA] Bug 12654 Correct incorrectly quoted regexp (1.48 KB, patch)
2014-07-29 21:24 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Campbell 2014-07-24 16:01:51 UTC
An incorrect quote of a metacharacter in a regexp in AuthoritiesMarc.pm causes a compile time warning : Useless use of '\'; doesn't escape metacharacter '(' at /home/cc/kohaclone/C4/AuthoritiesMarc.pm line 856.    
    

annoyingly this crops up every time the module is compiled (e.g. in runs of rebuildzebra Let's quote correctly and silence the message
Comment 1 Colin Campbell 2014-07-24 16:21:06 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2014-07-29 07:01:53 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2014-07-29 21:24:25 UTC
Created attachment 30312 [details] [review]
[PASSED QA] Bug 12654 Correct incorrectly quoted regexp

A compile time warning was being generated because \ does not quote
{ Replace the plethora of \ before meta and presumed meta characters
by \Q \E which gets perl to generate all the necessary escapes, we can
assume it knows its regex engine as well or better than the human
programmer

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Verified change reading the perldoc and also checked that
./misc/link_bibs_to_authorities.pl is no longer showing
the warn and still works.
Comment 4 Tomás Cohen Arazi 2014-07-30 14:15:22 UTC
Patch pushed to master.

Thanks Colin!
Comment 5 Jonathan Druart 2015-04-28 10:08:27 UTC
*** Bug 12364 has been marked as a duplicate of this bug. ***