Commit bcb9385d authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 926085: Forbird single quotes to delimit URLs (no <a href='...'>)

r=dkl a=glob
parent 1ef5cef3
...@@ -20,7 +20,7 @@ use CGI qw(-no_debug); ...@@ -20,7 +20,7 @@ use CGI qw(-no_debug);
use File::Spec; use File::Spec;
use Template; use Template;
use Test::More tests => ( scalar(@referenced_files) + $num_actual_files ); use Test::More tests => ( scalar(@referenced_files) + 2 * $num_actual_files );
# Capture the TESTOUT from Test::More or Test::Builder for printing errors. # Capture the TESTOUT from Test::More or Test::Builder for printing errors.
# This will handle verbosity for us automatically. # This will handle verbosity for us automatically.
...@@ -104,6 +104,20 @@ foreach my $include_path (@include_paths) { ...@@ -104,6 +104,20 @@ foreach my $include_path (@include_paths) {
ok(0, "$path has bad syntax --ERROR"); ok(0, "$path has bad syntax --ERROR");
print $fh $data . "\n"; print $fh $data . "\n";
} }
# Make sure no forbidden constructs are present.
local $/;
open(FILE, '<', $path) or die "Can't open $file: $!\n";
$data = <FILE>;
close (FILE);
# Forbid single quotes to delimit URLs, see bug 926085.
if ($data =~ /href=\\?'/) {
ok(0, "$path contains blacklisted constructs: href='...'");
}
else {
ok(1, "$path contains no blacklisted constructs");
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment