SA Bugzilla – Bug 8023
Lint error when using Captured tags with "uri" rule
Last modified: 2022-08-11 13:25:34 UTC
The following rule gives a lint error with a modern Perl version. header __GB_FROM_ADDR From:addr =~ /(?<GB_FROM_ADDR>.*)/ uri GB_STORAGE_GOOGLE_EMAIL m|^https?://storage\.cloud\.google\.com/.{4,128}\#%{GB_FROM_ADDR}|i The lint error is: Aug 11 11:05:22.290 [14234] warn: Unescaped left brace in regex is passed through in regex; marked by <-- HERE in m/(?<!\\\\)\\%\\\\{ <-- HERE GB_FROM_ADDR\\\\}/ at (eval 4260) line 1795.
Created attachment 5789 [details] Proposed patch Possible fix for the issue, lint errors are fixed and the rule still works.
Atleast test was bad as it didn't catch the warnings, now it should: Sending t/regexp_named_capture.t Transmitting file data .done Committing transaction... Committed revision 1903347. Your fix seems to work, let's test few more versions... head hurts with all the escaping stages..
Check \%{} in test: Committed revision 1903351. The fix looks ok in 5.14 and 5.32... feel free to commit when happy..
Sending lib/Mail/SpamAssassin/Plugin/Check.pm Transmitting file data .done Committing transaction... Committed revision 1903359.