[Rt-commit] rt branch, 4.0/regex-escape-braces, created. rt-4.0.8rc1-4-g90bc9d1

? sunnavy sunnavy at bestpractical.com
Mon Oct 22 11:32:01 EDT 2012


The branch, 4.0/regex-escape-braces has been created
        at  90bc9d1ca89ca2fca7235adfc472c85ad8b815bc (commit)

- Log -----------------------------------------------------------------
commit 90bc9d1ca89ca2fca7235adfc472c85ad8b815bc
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Oct 22 23:16:22 2012 +0800

    unescaped braces in regex are deprecated in 5.17

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 99aa7b6..afefe7a 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -2938,7 +2938,7 @@ sub GetColumnMapEntry {
     }
 
     # complex things
-    elsif ( my ( $mainkey, $subkey ) = $args{'Name'} =~ /^(.*?)\.{(.+)}$/ ) {
+    elsif ( my ( $mainkey, $subkey ) = $args{'Name'} =~ /^(.*?)\.\{(.+)\}$/ ) {
         return undef unless $args{'Map'}->{$mainkey};
         return $args{'Map'}{$mainkey}{ $args{'Attribute'} }
             unless ref $args{'Map'}{$mainkey}{ $args{'Attribute'} } eq 'CODE';
diff --git a/lib/RT/Report/Tickets.pm b/lib/RT/Report/Tickets.pm
index de40dbd..828df66 100644
--- a/lib/RT/Report/Tickets.pm
+++ b/lib/RT/Report/Tickets.pm
@@ -102,7 +102,7 @@ sub Groupings {
 sub Label {
     my $self = shift;
     my $field = shift;
-    if ( $field =~ /^(?:CF|CustomField)\.{(.*)}$/ ) {
+    if ( $field =~ /^(?:CF|CustomField)\.\{(.*)\}$/ ) {
         my $cf = $1;
         return $self->CurrentUser->loc( "Custom field '[_1]'", $cf ) if $cf =~ /\D/;
         my $obj = RT::CustomField->new( $self->CurrentUser );
@@ -230,7 +230,7 @@ sub _FieldToFunction {
             $func = "SUBSTR($func,1,4)";
         }
         $args{'FUNCTION'} = $func;
-    } elsif ( $field =~ /^(?:CF|CustomField)\.{(.*)}$/ ) { #XXX: use CFDecipher method
+    } elsif ( $field =~ /^(?:CF|CustomField)\.\{(.*)\}$/ ) { #XXX: use CFDecipher method
         my $cf_name = $1;
         my $cf = RT::CustomField->new( $self->CurrentUser );
         $cf->Load($cf_name);
diff --git a/share/html/REST/1.0/Forms/ticket/default b/share/html/REST/1.0/Forms/ticket/default
index 016a50c..e8538c1 100755
--- a/share/html/REST/1.0/Forms/ticket/default
+++ b/share/html/REST/1.0/Forms/ticket/default
@@ -408,13 +408,13 @@ else {
                             $s =~ s/\\'/'/g;
                             push @new, $s;
                         }
-                        elsif ( $a =~ /^q{/ ) {
+                        elsif ( $a =~ /^q\{/ ) {
                             my $s = $a;
                             while ( $a !~ /}$/ ) {
                                 ( $a, $b ) = split /\s*,\s*/, $b, 2;
                                 $s .= ',' . $a;
                             }
-                            $s =~ s/^q{//;
+                            $s =~ s/^q\{//;
                             $s =~ s/}//;
                             push @new, $s;
                         }
diff --git a/share/html/Search/Build.html b/share/html/Search/Build.html
index c670559..3b2b5aa 100644
--- a/share/html/Search/Build.html
+++ b/share/html/Search/Build.html
@@ -190,7 +190,7 @@ my @new_values = ();
 
 # Try to find if we're adding a clause
 foreach my $arg ( keys %ARGS ) {
-    next unless $arg =~ m/^ValueOf(\w+|'CF.{.*?}')$/
+    next unless $arg =~ m/^ValueOf(\w+|'CF.\{.*?\}')$/
                 && ( ref $ARGS{$arg} eq "ARRAY"
                      ? grep $_ ne '', @{ $ARGS{$arg} }
                      : $ARGS{$arg} ne '' );
@@ -234,7 +234,7 @@ foreach my $arg ( keys %ARGS ) {
             $value = "'$value'";
         }
 
-        if ($keyword =~ /^'CF\.{(.*)}'/) {
+        if ($keyword =~ /^'CF\.\{(.*)\}'/) {
             my $cf = $1;
             $cf =~ s/(['\\])/\\$1/g;
             $keyword = "'CF.{$cf}'";
diff --git a/share/html/Search/Chart.html b/share/html/Search/Chart.html
index 571c3d3..c9e53ad 100644
--- a/share/html/Search/Chart.html
+++ b/share/html/Search/Chart.html
@@ -55,7 +55,7 @@ $ARGS{Query} ||= 'id > 0';
 
 # FIXME: should be factored with RT::Report::Tickets::Label :(
 my $PrimaryGroupByLabel;
-if ( $PrimaryGroupBy =~ /^(?:CF|CustomField)\.{(.*)}$/ ) {
+if ( $PrimaryGroupBy =~ /^(?:CF|CustomField)\.\{(.*)\}$/ ) {
     my $cf = $1;
     if ( $cf =~ /\D/ ) {
         $PrimaryGroupByLabel = loc( "custom field '[_1]'", $cf );

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


More information about the Rt-commit mailing list