| Summary: | Incorrect quoting in regexp in AuthoritiesMarc | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Colin Campbell <colin.campbell> |
| Component: | MARC Authority data support | Assignee: | Colin Campbell <colin.campbell> |
| Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
| Severity: | minor | ||
| Priority: | P5 - low | CC: | jcamins, tomascohen |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | Small patch |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
| Attachments: |
Proposed patch
Bug 12654 Correct incorrectly quoted regexp [PASSED QA] Bug 12654 Correct incorrectly quoted regexp |
||
Created attachment 30040 [details] [review] Proposed patch use \Q |E to get perl to quote neta characters To test perl -wc AuthoritiesMarc.pm should no longer complain with the error message in the bug Created attachment 30262 [details] [review] 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> 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. Patch pushed to master. Thanks Colin! |
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