[Rt-commit] rt branch, 4.2/regex-escape-braces, created. rt-4.2.10-220-g5568ca5

? sunnavy sunnavy at bestpractical.com
Mon Mar 23 09:29:28 EDT 2015


The branch, 4.2/regex-escape-braces has been created
        at  5568ca578e208f2ba9aff91d9e3d762b751bbf22 (commit)

- Log -----------------------------------------------------------------
commit 5568ca578e208f2ba9aff91d9e3d762b751bbf22
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Mar 23 21:24:21 2015 +0800

    fix "Unescaped left brace in regex is deprecated" warning with perl 5.21.1+
    
    right braces are also escaped to make it look more consistent.

diff --git a/etc/upgrade/3.8.9/content b/etc/upgrade/3.8.9/content
index 4a6f0bd..d0a2516 100644
--- a/etc/upgrade/3.8.9/content
+++ b/etc/upgrade/3.8.9/content
@@ -55,7 +55,7 @@ our @Initial = (
 
             # there is only one OwnerObj->Name normally, so no need /g
             if ( $content =~
-s!(?<=Your ticket has been (?:approved|rejected) by { eval { )\$Approval->OwnerObj->Name!\$Approver->Name!
+s!(?<=Your ticket has been (?:approved|rejected) by \{ eval \{ )\$Approval->OwnerObj->Name!\$Approver->Name!
               )
             {
                 $template->SetType('Perl');
diff --git a/lib/RT/Interface/REST.pm b/lib/RT/Interface/REST.pm
index a198d13..b6f9fd3 100644
--- a/lib/RT/Interface/REST.pm
+++ b/lib/RT/Interface/REST.pm
@@ -298,7 +298,7 @@ sub vsplit {
                            (')   # Single-quoted string
                            ((?>[^\\']*(?:\\.[^\\']*)*))'
                        |
-                           q{(.*?)}  # A perl-ish q{} string; this does
+                           q\{(.*?)\}  # A perl-ish q{} string; this does
                                      # no paren balancing, however, and
                                      # only exists for back-compat
                        |
diff --git a/lib/RT/Migrate/Incremental.pm b/lib/RT/Migrate/Incremental.pm
index 5d0eaac..61aea6c 100644
--- a/lib/RT/Migrate/Incremental.pm
+++ b/lib/RT/Migrate/Incremental.pm
@@ -245,7 +245,7 @@ our %UPGRADES = (
             return unless $queue->Id and $queue->Name eq "___Approvals";
 
             $ref->{Content} =~
-s!(?<=Your ticket has been (?:approved|rejected) by { eval { )\$Approval->OwnerObj->Name!\$Approver->Name!;
+s!(?<=Your ticket has been (?:approved|rejected) by \{ eval \{ )\$Approval->OwnerObj->Name!\$Approver->Name!;
         },
     },
 
diff --git a/t/web/rest.t b/t/web/rest.t
index 3a84b2a..8b8cbcb 100644
--- a/t/web/rest.t
+++ b/t/web/rest.t
@@ -204,7 +204,7 @@ is($link, 1, "Check ticket link.") or diag("'content' obtained:\n", $m->content)
     $text = $m->content;
     $text =~ s/.*?\n\n//;
     $text =~ s/\n\n/\n/;
-    $text =~ s{CF\.{severity}:.*\n}{}img;
+    $text =~ s{CF\.\{severity\}:.*\n}{}img;
     $text .= "CF.{severity}: explosive, a bit\n";
     $m->post(
         "$baseurl/REST/1.0/ticket/edit",
@@ -234,7 +234,7 @@ is($link, 1, "Check ticket link.") or diag("'content' obtained:\n", $m->content)
         ]
     );
     $text = $m->content;
-    $text =~ s{CF\.{severity}:.*\n}{}img;
+    $text =~ s{CF\.\{severity\}:.*\n}{}img;
     $text .= "CF.{severity}:\n";
     $m->post(
         "$baseurl/REST/1.0/ticket/edit",
@@ -301,7 +301,7 @@ is($link, 1, "Check ticket link.") or diag("'content' obtained:\n", $m->content)
         ]
     );
     $text = $m->content;
-    $text =~ s{CF\.{single}:.*\n}{}img;
+    $text =~ s{CF\.\{single\}:.*\n}{}img;
     $text .= "CF.{single}: that\n";
     $m->post(
         "$baseurl/REST/1.0/ticket/edit",

-----------------------------------------------------------------------


More information about the rt-commit mailing list