mozilla/
. This ' .
+ 'means URLs are relative to that extra path under the root. ' .
+ 'Enter this if you have a similar situation. Leave it blank ' .
+ 'if you don\'t know what this is.',
+ type => 't',
+ default => '',
+ },
);
1;
diff --git a/globals.pl b/globals.pl
index 134bddb28..67fed5306 100644
--- a/globals.pl
+++ b/globals.pl
@@ -75,7 +75,7 @@ use DBI;
use Date::Format; # For time2str().
use Date::Parse; # For str2time().
-#use Carp; # for confess
+use Carp; # for confess
use RelationSet;
# Use standard Perl libraries for cross-platform file/directory manipulation.
@@ -98,12 +98,12 @@ $::SIG{PIPE} = 'IGNORE';
$::defaultqueryname = "(Default query)"; # This string not exposed in UI
$::unconfirmedstate = "UNCONFIRMED";
-#sub die_with_dignity {
-# my ($err_msg) = @_;
-# print $err_msg;
-# confess($err_msg);
-#}
-#$::SIG{__DIE__} = \&die_with_dignity;
+sub die_with_dignity {
+ my ($err_msg) = @_;
+ print $err_msg;
+ confess($err_msg);
+}
+$::SIG{__DIE__} = \&die_with_dignity;
@::default_column_list = ("bug_severity", "priority", "rep_platform",
"assigned_to", "bug_status", "resolution",
diff --git a/t/008filter.t b/t/008filter.t
index fc8f77e69..0d6ec4b49 100644
--- a/t/008filter.t
+++ b/t/008filter.t
@@ -101,60 +101,13 @@ foreach my $path (@Support::Templates::include_paths) {
my @lineno = ($` =~ m/\n/gs);
my $lineno = scalar(@lineno) + 1;
- # Comments
- next if $directive =~ /^[+-]?#/;
+ if (!directive_ok($file, $directive)) {
- # Remove any leading/trailing + or - and whitespace.
- $directive =~ s/^[+-]?\s*//;
- $directive =~ s/\s*[+-]?$//;
-
- # Directives
- next if $directive =~ /^(IF|END|UNLESS|FOREACH|PROCESS|INCLUDE|
- BLOCK|USE|ELSE|NEXT|LAST|DEFAULT|FLUSH|
- ELSIF|SET|SWITCH|CASE)/x;
-
- # Simple assignments
- next if $directive =~ /^[\w\.\$]+\s+=\s+/;
-
- # Conditional literals with either sort of quotes
- # There must be no $ in the string for it to be a literal
- next if $directive =~ /^(["'])[^\$]*[^\\]\1/;
-
- # Special values always used for numbers
- next if $directive =~ /^[ijkn]$/;
- next if $directive =~ /^count$/;
-
- # Params
- next if $directive =~ /^Param\(/;
-
- # Other functions guaranteed to return OK output
- next if $directive =~ /^(time2str|GetBugLink)\(/;
-
- # Safe Template Toolkit virtual methods
- next if $directive =~ /\.(size)$/;
-
- # Special Template Toolkit loop variable
- next if $directive =~ /^loop\.(index|count)$/;
-
- # Branding terms
- next if $directive =~ /^terms\./;
-
- # Things which are already filtered
- # Note: If a single directive prints two things, and only one is
- # filtered, we may not catch that case.
- next if $directive =~ /FILTER\ (html|csv|js|url_quote|quoteUrls|
- time|uri|xml)/x;
-
- # Exclude those on the nofilter list
- if (defined($safe{$file}{$directive})) {
- $safe{$file}{$directive}++;
- next;
- };
-
- # This intentionally makes no effort to eliminate duplicates; to do
- # so would merely make it more likely that the user would not
- # escape all instances when attempting to correct an error.
- push(@unfiltered, "$lineno:$directive");
+ # This intentionally makes no effort to eliminate duplicates; to do
+ # so would merely make it more likely that the user would not
+ # escape all instances when attempting to correct an error.
+ push(@unfiltered, "$lineno:$directive");
+ }
}
my $fullpath = File::Spec->catfile($path, $file);
@@ -183,6 +136,74 @@ foreach my $path (@Support::Templates::include_paths) {
}
}
+sub directive_ok {
+ my ($file, $directive) = @_;
+
+ # Comments
+ return 1 if $directive =~ /^[+-]?#/;
+
+ # Remove any leading/trailing + or - and whitespace.
+ $directive =~ s/^[+-]?\s*//;
+ $directive =~ s/\s*[+-]?$//;
+
+ # Exclude those on the nofilter list
+ if (defined($safe{$file}{$directive})) {
+ $safe{$file}{$directive}++;
+ return 1;
+ };
+
+ # Directives
+ return 1 if $directive =~ /^(IF|END|UNLESS|FOREACH|PROCESS|INCLUDE|
+ BLOCK|USE|ELSE|NEXT|LAST|DEFAULT|FLUSH|
+ ELSIF|SET|SWITCH|CASE|WHILE)/x;
+
+ # ? :
+ if ($directive =~ /.+\?(.+):(.+)/) {
+ return 1 if directive_ok($file, $1) && directive_ok($file, $2);
+ }
+
+ # + - * /
+ return 1 if $directive =~ /[+\-*\/]/;
+
+ # Numbers
+ return 1 if $directive =~ /^[0-9]+$/;
+
+ # Simple assignments
+ return 1 if $directive =~ /^[\w\.\$]+\s+=\s+/;
+
+ # Conditional literals with either sort of quotes
+ # There must be no $ in the string for it to be a literal
+ return 1 if $directive =~ /^(["'])[^\$]*[^\\]\1/;
+ return 1 if $directive =~ /^(["'])\1/;
+
+ # Special values always used for numbers
+ return 1 if $directive =~ /^[ijkn]$/;
+ return 1 if $directive =~ /^count$/;
+
+ # Params
+ return 1 if $directive =~ /^Param\(/;
+
+ # Other functions guaranteed to return OK output
+ return 1 if $directive =~ /^(time2str|GetBugLink|url)\(/;
+
+ # Safe Template Toolkit virtual methods
+ return 1 if $directive =~ /\.(size)$/;
+
+ # Special Template Toolkit loop variable
+ return 1 if $directive =~ /^loop\.(index|count)$/;
+
+ # Branding terms
+ return 1 if $directive =~ /^terms\./;
+
+ # Things which are already filtered
+ # Note: If a single directive prints two things, and only one is
+ # filtered, we may not catch that case.
+ return 1 if $directive =~ /FILTER\ (html|csv|js|url_quote|quoteUrls|
+ time|uri|xml|lower)/x;
+
+ return 0;
+}
+
$/ = $oldrecsep;
exit 0;
diff --git a/template/en/default/attachment/diff-file.html.tmpl b/template/en/default/attachment/diff-file.html.tmpl
new file mode 100644
index 000000000..51072269d
--- /dev/null
+++ b/template/en/default/attachment/diff-file.html.tmpl
@@ -0,0 +1,129 @@
+
+[%# The contents of this file are subject to the Mozilla Public
+ # License Version 1.1 (the "License"); you may not use this file
+ # except in compliance with the License. You may obtain a copy of
+ # the License at http://www.mozilla.org/MPL/
+ #
+ # Software distributed under the License is distributed on an "AS
+ # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ # implied. See the License for the specific language governing
+ # rights and limitations under the License.
+ #
+ # The Original Code is the Bugzilla Bug Tracking System.
+ #
+ # The Initial Developer of the Original Code is Netscape Communications
+ # Corporation. Portions created by Netscape are
+ # Copyright (C) 1998 Netscape Communications Corporation. All
+ # Rights Reserved.
+ #
+ # Contributor(s): John Keiser [% collapsed ? '(+)' : '(-)' %] + [% IF lxr_prefix && !file.is_add %] + [% file.filename FILTER html %] + [% ELSE %] + [% file.filename FILTER html %] + [% END %] + [% IF file.plus_lines %] + [% IF file.minus_lines %] + (-[% file.minus_lines %] / +[% file.plus_lines %] lines) + [% ELSE %] + (+[% file.plus_lines %] lines) + [% END %] + [% ELSE %] + [% IF file.minus_lines %] + (-[% file.minus_lines %] lines) + [% END %] + [% END %] + | |
+ [% IF file.is_add %] + Added + [% ELSIF file.is_remove %] + [% IF bonsai_prefix %] + Removed + [% ELSE %] + Removed + [% END %] + [% ELSE %] + [% IF bonsai_prefix %] + + [% END %] + [% IF section.old_lines > 1 %] + Lines [% section.old_start %]-[% section.old_start + section.old_lines - 1 %] + [% ELSE %] + Line [% section.old_start %] + [% END %] + [% IF bonsai_prefix %] + + [% END %] + [% END %] + (Link Here) + | |
---|---|
[% line FILTER html %] | [% line FILTER html %] |
[% group.minus.$i FILTER html %] |
+ [% group.plus.$i FILTER html %] |
+
[% line FILTER html %] |
+ |
+ | [% line FILTER html %] |
+
[% line FILTER html %] |
+ |
[% line FILTER html %] |
+ + |