]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 602832: 008filter.t doesn't catch [%~ ~%] correctly
authorFrédéric Buclin <LpSolit@gmail.com>
Sat, 9 Oct 2010 11:17:30 +0000 (13:17 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Sat, 9 Oct 2010 11:17:30 +0000 (13:17 +0200)
r/a=mkanat

t/008filter.t

index 0c38380df1c90a88298157ba40f251ccbeb86dcb..c0ee3b1314b55d1c28eb65aab2a8e1c74384ca75 100644 (file)
@@ -110,7 +110,7 @@ foreach my $path (@Support::Templates::include_paths) {
 
         # /g means we execute this loop for every match
         # /s means we ignore linefeeds in the regexp matches
-        while ($slurp =~ /\[%(.*?)%\]/gs) {
+        while ($slurp =~ /\[%(?:-|\+|~)?(.*?)(?:-|\+|~)?%\]/gs) {
             my $directive = $1;
 
             my @lineno = ($` =~ m/\n/gs);
@@ -155,11 +155,11 @@ sub directive_ok {
     my ($file, $directive) = @_;
 
     # Comments
-    return 1 if $directive =~ /^[+-]?#/;        
+    return 1 if $directive =~ /^#/;        
 
-    # Remove any leading/trailing + or - and whitespace.
-    $directive =~ s/^[+-]?\s*//;
-    $directive =~ s/\s*[+-]?$//;
+    # Remove any leading/trailing whitespace.
+    $directive =~ s/^\s*//;
+    $directive =~ s/\s*$//;
 
     # Empty directives are ok; they are usually line break helpers
     return 1 if $directive eq '';