From 61440fab138cf4d05491cb0b1af6b2aebc50a13c Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Thu, 24 Jul 2014 17:12:42 +0100 Subject: [PATCH] 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 Signed-off-by: Katrin Fischer Verified change reading the perldoc and also checked that ./misc/link_bibs_to_authorities.pl is no longer showing the warn and still works. Signed-off-by: Tomas Cohen Arazi Works as described, running: prove t/db_dependent/AuthoritiesMarc.t doesn't show the warning anymore. --- C4/AuthoritiesMarc.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 95fe33a732..e983159f63 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -853,7 +853,7 @@ sub FindDuplicateAuthority { $op = 'and'; } my $query='at:'.$authtypecode.' '; - my $filtervalues=qr([\001-\040\!\'\"\`\#\$\%\&\*\+,\-\./:;<=>\?\@\(\)\{\[\]\}_\|\~]); + my $filtervalues=qr([\001-\040\Q!'"`#$%&*+,-./:;<=>?@(){[}_|~\E\]]); if ($record->field($auth_tag_to_report)) { foreach ($record->field($auth_tag_to_report)->subfields()) { $_->[1]=~s/$filtervalues/ /g; $query.= " $op he:\"".$_->[1]."\"" if ($_->[0]=~/[A-z]/); -- 2.39.5