Bug 148488 - more HTML validation fixes

r=jouni, gerv
This commit is contained in:
bbaetz%student.usyd.edu.au 2002-06-28 00:18:32 +00:00
Родитель 49a8f28b22
Коммит e1bf593dd0
23 изменённых файлов: 52 добавлений и 247 удалений

Просмотреть файл

@ -353,21 +353,21 @@ sub navigation_links($) {
my $cur = lsearch(\@bugs, $::FORM{"id"}); my $cur = lsearch(\@bugs, $::FORM{"id"});
if ($cur > 0) { if ($cur > 0) {
$retval .= "<link rel=\"First\" href=\"show_bug.cgi?id=$bugs[0]\" />\n"; $retval .= "<link rel=\"First\" href=\"show_bug.cgi?id=$bugs[0]\">\n";
$retval .= "<link rel=\"Prev\" href=\"show_bug.cgi?id=$bugs[$cur - 1]\" />\n"; $retval .= "<link rel=\"Prev\" href=\"show_bug.cgi?id=$bugs[$cur - 1]\">\n";
} }
if ($cur < $#bugs) { if ($cur < $#bugs) {
$retval .= "<link rel=\"Next\" href=\"show_bug.cgi?id=$bugs[$cur + 1]\" />\n"; $retval .= "<link rel=\"Next\" href=\"show_bug.cgi?id=$bugs[$cur + 1]\">\n";
$retval .= "<link rel=\"Last\" href=\"show_bug.cgi?id=$bugs[$#bugs]\" />\n"; $retval .= "<link rel=\"Last\" href=\"show_bug.cgi?id=$bugs[$#bugs]\">\n";
} }
$retval .= "<link rel=\"Up\" href=\"buglist.cgi?regetlastlist=1\" />\n"; $retval .= "<link rel=\"Up\" href=\"buglist.cgi?regetlastlist=1\">\n";
$retval .= "<link rel=\"Contents\" href=\"buglist.cgi?regetlastlist=1\" />\n"; $retval .= "<link rel=\"Contents\" href=\"buglist.cgi?regetlastlist=1\">\n";
} else { } else {
# We are on a bug list # We are on a bug list
$retval .= "<link rel=\"First\" href=\"show_bug.cgi?id=$bugs[0]\" />\n"; $retval .= "<link rel=\"First\" href=\"show_bug.cgi?id=$bugs[0]\">\n";
$retval .= "<link rel=\"Next\" href=\"show_bug.cgi?id=$bugs[0]\" />\n"; $retval .= "<link rel=\"Next\" href=\"show_bug.cgi?id=$bugs[0]\">\n";
$retval .= "<link rel=\"Last\" href=\"show_bug.cgi?id=$bugs[$#bugs]\" />\n"; $retval .= "<link rel=\"Last\" href=\"show_bug.cgi?id=$bugs[$#bugs]\">\n";
} }
} }
@ -972,7 +972,7 @@ sub ThrowTemplateError {
send it to $maintainer with details of what you were doing at the send it to $maintainer with details of what you were doing at the
time this message appeared. time this message appeared.
</p> </p>
<script> <!-- <script type="text/javascript"> <!--
document.write("<p>URL: " + document.location + "</p>"); document.write("<p>URL: " + document.location + "</p>");
// --> // -->
</script> </script>

Просмотреть файл

@ -832,7 +832,7 @@ sub GenerateSQL {
$F{"type$chart-$row-$col"} = shift(@$ref); $F{"type$chart-$row-$col"} = shift(@$ref);
$F{"value$chart-$row-$col"} = shift(@$ref); $F{"value$chart-$row-$col"} = shift(@$ref);
if ($debug) { if ($debug) {
print qq{<P>$F{"field$chart-$row-$col"} | $F{"type$chart-$row-$col"} | $F{"value$chart-$row-$col"}*\n}; print qq{<p>$F{"field$chart-$row-$col"} | $F{"type$chart-$row-$col"} | $F{"value$chart-$row-$col"}*</p>\n};
} }
$col++; $col++;
@ -971,7 +971,7 @@ sub GenerateSQL {
if ("$f,$t" =~ m/$key/) { if ("$f,$t" =~ m/$key/) {
my $ref = $funcsbykey{$key}; my $ref = $funcsbykey{$key};
if ($debug) { if ($debug) {
print "<P>$key ($f , $t ) => "; print "<p>$key ($f , $t ) => ";
} }
$ff = $f; $ff = $f;
if ($f !~ /\./) { if ($f !~ /\./) {
@ -979,7 +979,7 @@ sub GenerateSQL {
} }
&$ref; &$ref;
if ($debug) { if ($debug) {
print "$f , $t , $term"; print "$f , $t , $term</p>";
} }
if ($term) { if ($term) {
last; last;
@ -1020,7 +1020,7 @@ sub GenerateSQL {
$query = SelectVisible($query, $::userid, $::usergroupset); $query = SelectVisible($query, $::userid, $::usergroupset);
if ($debug) { if ($debug) {
print "<P><CODE>" . value_quote($query) . "</CODE><P>\n"; print "<p><code>" . value_quote($query) . "</code></p>\n";
exit; exit;
} }
return $query; return $query;

Просмотреть файл

@ -1,39 +0,0 @@
#!/usr/bonsaitools/bin/perl -wT
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# 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): Terry Weissman <terry@mozilla.org>
use strict;
print q{Content-type: text/html
<HTML>
<HEAD>
<META HTTP-EQUIV="Refresh"
CONTENT="0; URL=userprefs.cgi">
</HEAD>
<BODY>
This URL is obsolete. Forwarding you to the correct one.
<P>
Going to <A HREF="userprefs.cgi">userprefs.cgi</A>
<BR>
</BODY>
</HTML>
}

Просмотреть файл

@ -806,14 +806,14 @@ if ($my_index_html) {
open HTML, ">index.html"; open HTML, ">index.html";
print HTML <<'END'; print HTML <<'END';
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML> <html>
<HEAD> <head>
<META HTTP-EQUIV="REFRESH" CONTENT="0; URL=index.cgi"> <meta http-equiv="Refresh" content="0; URL=index.cgi">
</HEAD> </head>
<BODY> <body>
<H1>I think you are looking for <a href="index.cgi">index.cgi</a></H1> <h1>I think you are looking for <a href="index.cgi">index.cgi</a></h1>
</BODY> </body>
</HTML> </html>
END END
close HTML; close HTML;
} }

Просмотреть файл

@ -88,8 +88,8 @@ if (defined $::FORM{'rememberedquery'}) {
print "Set-Cookie: SPLITHEADER=$::FORM{'splitheader'} ; path=$cookiepath ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n"; print "Set-Cookie: SPLITHEADER=$::FORM{'splitheader'} ; path=$cookiepath ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n";
print "Refresh: 0; URL=buglist.cgi?$::FORM{'rememberedquery'}\n"; print "Refresh: 0; URL=buglist.cgi?$::FORM{'rememberedquery'}\n";
print "\n"; print "\n";
print "<META HTTP-EQUIV=Refresh CONTENT=\"1; URL=$urlbase"."buglist.cgi?$::FORM{'rememberedquery'}\">\n"; print "<meta http-equiv=\"Refresh\" content=\"1; URL=$urlbase"."buglist.cgi?$::FORM{'rememberedquery'}\">\n";
print "<TITLE>What a hack.</TITLE>\n"; print "<title>What a hack.</title>\n";
PutHeader ("Change columns"); PutHeader ("Change columns");
print "Resubmitting your query with new columns...\n"; print "Resubmitting your query with new columns...\n";
exit; exit;

Просмотреть файл

@ -204,7 +204,7 @@ DefParam("LDAPmailattribute",
DefParam("mostfreqthreshold", DefParam("mostfreqthreshold",
"The minimum number of duplicates a bug needs to show up on the <A HREF=\"duplicates.cgi\">most frequently reported bugs page</a>. If you have a large database and this page takes a long time to load, try increasing this number.", "The minimum number of duplicates a bug needs to show up on the <a href=\"duplicates.cgi\">most frequently reported bugs page</a>. If you have a large database and this page takes a long time to load, try increasing this number.",
"t", "t",
"2"); "2");

Просмотреть файл

@ -947,7 +947,7 @@ sub DBNameToIdAndCheck {
} }
$name = html_quote($name); $name = html_quote($name);
ThrowUserError("The name <TT>$name</TT> is not a valid username. ThrowUserError("The name <tt>$name</tt> is not a valid username.
Either you misspelled it, or the person has not Either you misspelled it, or the person has not
registered for a Bugzilla account."); registered for a Bugzilla account.");
} }

Просмотреть файл

@ -55,17 +55,17 @@ my $offervotecacherebuild = 0;
sub Status { sub Status {
my ($str) = (@_); my ($str) = (@_);
print "$str <P>\n"; print "$str <p>\n";
} }
sub Alert { sub Alert {
my ($str) = (@_); my ($str) = (@_);
Status("<font color=red>$str</font>"); Status("<font color=\"red\">$str</font>");
} }
sub BugLink { sub BugLink {
my ($id) = (@_); my ($id) = (@_);
return "<a href='show_bug.cgi?id=$id'>$id</a>"; return "<a href=\"show_bug.cgi?id=$id\">$id</a>";
} }
sub AlertBadVoteCache { sub AlertBadVoteCache {
@ -142,7 +142,7 @@ if (exists $::FORM{'rebuildvotecache'}) {
Status("Vote cache has been rebuilt."); Status("Vote cache has been rebuilt.");
} }
print "OK, now running sanity checks.<P>\n"; print "OK, now running sanity checks.<p>\n";
# This one goes first, because if this is wrong, then the below tests # This one goes first, because if this is wrong, then the below tests
# will probably fail too # will probably fail too

Просмотреть файл

@ -45,10 +45,10 @@ sub CreateImagemap {
open MAP, "<$mapfilename"; open MAP, "<$mapfilename";
while(my $line = <MAP>) { while(my $line = <MAP>) {
if($line =~ /^default ([^ ]*)(.*)$/) { if($line =~ /^default ([^ ]*)(.*)$/) {
$default = qq{<area shape="default" href="$1">\n}; $default = qq{<area alt="" shape="default" href="$1">\n};
} }
if ($line =~ /^rectangle \((.*),(.*)\) \((.*),(.*)\) (http[^ ]*)(.*)?$/) { if ($line =~ /^rectangle \((.*),(.*)\) \((.*),(.*)\) (http[^ ]*)(.*)?$/) {
$map .= qq{<area name="bug$6" shape="rect" href="$5" coords="$1,$4,$3,$2">\n}; $map .= qq{<area alt="bug$6" name="bug$6" shape="rect" href="$5" coords="$1,$4,$3,$2">\n};
} }
} }
close MAP; close MAP;

Просмотреть файл

@ -35,7 +35,7 @@
<table> <table>
<tr> <tr>
<th align="right">Old Email Address:</th> <th align="right">Old Email Address:</th>
<td><input type="input" name="email" size="36"></td> <td><input type="text" name="email" size="36"></td>
</tr> </tr>
<tr> <tr>
<th align="right"> </th> <th align="right"> </th>

Просмотреть файл

@ -97,7 +97,7 @@
<h3>[% current_tab.description %]</h3> <h3>[% current_tab.description %]</h3>
<form method="post"> <form method="post" action="userprefs.cgi">
<input type="hidden" name="tab" value="[% current_tab.name %]"> <input type="hidden" name="tab" value="[% current_tab.name %]">
[% PROCESS "account/prefs/${current_tab.name}.html.tmpl" IF current_tab.name.defined %] [% PROCESS "account/prefs/${current_tab.name}.html.tmpl" IF current_tab.name.defined %]

Просмотреть файл

@ -1,55 +0,0 @@
<!-- 1.0@bugzilla.org -->
[%# 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): Myk Melez <myk@mozilla.org>
# Jeff Hedlund <jeff.hedlund@matrixsi.com>
#%]
[%# Filter off the name here to be used multiple times below %]
[% name = name FILTER html %]
[% PROCESS global/header.html.tmpl
title = "Confirm Delete of Attachment Status '$name'"
%]
<p>
[% attachcount %] attachments have the status '[% name %]'. If you delete
it, those attachments will lose this status.
</p>
<table>
<tr>
<td colspan=2>
Do you really want to delete this status?
</td>
</tr>
<tr>
<td>
<a href="editattachstatuses.cgi?action=delete&id=[% id %]">
Yes, delete
</a>
</td>
<td align="right">
<a href="editattachstatuses.cgi">
No, don't delete
</a>
</td>
</tr>
</table>
[% PROCESS global/footer.html.tmpl %]

Просмотреть файл

@ -1,99 +0,0 @@
<!-- 1.0@bugzilla.org -->
[%# 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): Myk Melez <myk@mozilla.org>
#%]
[%# INTERFACE:
# statusdefs: list of hashes. may be empty. Each hash has six members:
# name: string. The name of the attachment status.
# description: string. Its description.
# sortkey: integer. Sorting priority.
# product: string. The product to which the attachment status applies.
# id: integer. Its internal ID number.
# attachcount: integer. How many attachments have that status.
#%]
[% PROCESS global/header.html.tmpl
title = 'Administer Attachment Statuses'
message = message
style = "
th { text-align: left; }
"
%]
<table cellspacing="0" cellpadding="4" border="1">
<tr>
<th>Name</th>
<th>Description</th>
<th>Sort Key</th>
<th>Product</th>
<th>Action(s)</th>
</tr>
[% FOREACH statusdef = statusdefs %]
<tr>
<td>[% statusdef.name FILTER html %]</td>
<td>[% statusdef.description FILTER html %]</td>
<td>[% statusdef.sortkey %]</td>
<td>[% statusdef.product FILTER html %]</td>
<td>
<a href="editattachstatuses.cgi?action=edit&id=[% statusdef.id %]">
Edit</a>
&nbsp;|&nbsp;
<a href="editattachstatuses.cgi?action=confirmdelete&id=[% statusdef.id %]"
onclick="return confirmDelete([% statusdef.attachcount %],
'[% statusdef.name FILTER js %]',
[% statusdef.id %]);">
Delete</a>
</td>
</tr>
[% END %]
<tr>
<td colspan="4"></td>
<td>
<a href="editattachstatuses.cgi?action=create">Create</a>
</td>
</tr>
</table>
<script language="JavaScript">
function confirmDelete(attachcount, name, id)
{
if (attachcount > 0) {
msg = attachcount + ' attachments have the status ' +
name + '. If you delete it, those attachments ' +
'will lose this status. Do you really want to ' +
'delete this status?';
}
else {
msg = 'Are you sure you want to delete attachment status ' +
name + '?';
}
if (confirm(msg)) {
location.href = "editattachstatuses.cgi?action=delete&id=" + id;
}
return false;
}
</script>
[% PROCESS global/footer.html.tmpl %]

Просмотреть файл

@ -53,7 +53,7 @@
var contentType = '[% contenttype %]'; var contentType = '[% contenttype %]';
if ( contentType == 'text/plain' ) if ( contentType == 'text/plain' )
{ {
theContent = theContent.replace( /^<html><head\/><body><pre>/i , "" ); theContent = theContent.replace( /^<html><head\/?><body><pre>/i , "" );
theContent = theContent.replace( /<\/pre><\/body><\/html>$/i , "" ); theContent = theContent.replace( /<\/pre><\/body><\/html>$/i , "" );
theContent = theContent.replace( /&lt;/gi , "<" ); theContent = theContent.replace( /&lt;/gi , "<" );
theContent = theContent.replace( /&gt;/gi , ">" ); theContent = theContent.replace( /&gt;/gi , ">" );

Просмотреть файл

@ -86,7 +86,7 @@
[% ELSE %] [% ELSE %]
<p><b> <p><b>
Attachment cannot be viewed because its MIME type is not text/*, image/*, or application/vnd.mozilla.*. Attachment cannot be viewed because its MIME type is not text/*, image/*, or application/vnd.mozilla.*.
<a href="attachment.cgi?id=[% a.attachid %]&action=view">Download the attachment instead</a>. <a href="attachment.cgi?id=[% a.attachid %]&amp;action=view">Download the attachment instead</a>.
</b></p> </b></p>
[% END %] [% END %]
</div> </div>

Просмотреть файл

@ -51,16 +51,16 @@
</p> </p>
[% IF image_map %] [% IF image_map %]
<img src="[% image_url %]" usemap="#imagemap"> <img src="[% image_url %]" alt="Dependency graph" usemap="#imagemap">
[% ELSE %] [% ELSE %]
<a href="[% map_url %]"> <a href="[% map_url %]">
<img src="[% image_url %]" ismap="ismap"> <img src="[% image_url %]" alt="Dependency graph" ismap="ismap">
</a> </a>
[% END %] [% END %]
<hr> <hr>
<form> <form action="showdependencygraph.cgi">
<table> <table>
<tr> <tr>
<td> <td>

Просмотреть файл

@ -49,7 +49,7 @@
Do you wish to do this? Do you wish to do this?
</p> </p>
<form method="post"> <form method="post" action="process_bug.cgi">
[% PROCESS "global/hidden-fields.html.tmpl" exclude="^(Bugzilla|LDAP)_(login|password)$" %] [% PROCESS "global/hidden-fields.html.tmpl" exclude="^(Bugzilla|LDAP)_(login|password)$" %]

Просмотреть файл

@ -59,7 +59,7 @@ You have the following choices:
<ul> <ul>
<li> <li>
<form method="post"> <form method="post" action="process_bug.cgi">
[% PROCESS "global/hidden-fields.html.tmpl" exclude="^(Bugzilla|LDAP)_(login|password)$" %] [% PROCESS "global/hidden-fields.html.tmpl" exclude="^(Bugzilla|LDAP)_(login|password)$" %]
<input type="submit" value="Submit my changes anyway"> <input type="submit" value="Submit my changes anyway">
This will cause all of the above changes to be overwritten This will cause all of the above changes to be overwritten

Просмотреть файл

@ -42,7 +42,7 @@
[%###########################################################################%] [%###########################################################################%]
[% BLOCK bug_display %] [% BLOCK bug_display %]
<img src="1x1.gif" width="1" height="80" align="left"> <img alt="" src="1x1.gif" width="1" height="80" align="left">
<div align="center"> <div align="center">
<b> <b>
<font ="+3">Bug [% bug.bug_id %] - [% bug.short_desc FILTER html %]</font> <font ="+3">Bug [% bug.bug_id %] - [% bug.short_desc FILTER html %]</font>

Просмотреть файл

@ -36,7 +36,7 @@
it to [% Param("maintainer") %] with details of what you were doing at it to [% Param("maintainer") %] with details of what you were doing at
the time this message appeared. the time this message appeared.
</p> </p>
<script> <!-- <script type="text/javascript"> <!--
document.write("<p>URL: " + document.location + "</p>"); document.write("<p>URL: " + document.location + "</p>");
// --> // -->
</script> </script>

Просмотреть файл

@ -43,7 +43,7 @@
Actions: Actions:
</td> </td>
<td valign="middle" nowrap> <td valign="middle" nowrap="nowrap">
<a href="enter_bug.cgi">New</a> | <a href="enter_bug.cgi">New</a> |
<a href="query.cgi">Query</a> | <a href="query.cgi">Query</a> |
@ -63,19 +63,19 @@
<td valign="middle"> <td valign="middle">
Edit <a href="userprefs.cgi">prefs</a> Edit <a href="userprefs.cgi">prefs</a>
[% ", <a href='editparams.cgi'>parameters</a>" [% ', <a href="editparams.cgi">parameters</a>'
IF user.groups.tweakparams %] IF user.groups.tweakparams %]
[% ", <a href='editusers.cgi'>users</a>" IF user.groups.editusers [% ', <a href="editusers.cgi">users</a>' IF user.groups.editusers
|| (user.blessgroupset > 0) %] || (user.blessgroupset > 0) %]
[% ", <a href='editproducts.cgi'>products</a>" [% ', <a href="editproducts.cgi">products</a>'
IF user.groups.editcomponents %] IF user.groups.editcomponents %]
[% ", <a href='editattachstatuses.cgi'> attachment&nbsp;statuses</a>" [% ', <a href="editattachstatuses.cgi"> attachment&nbsp;statuses</a>'
IF user.groups.editcomponents %] IF user.groups.editcomponents %]
[% ", <a href='editgroups.cgi'>groups</a>" [% ', <a href="editgroups.cgi">groups</a>'
IF user.groups.creategroups %] IF user.groups.creategroups %]
[% ", <a href='editkeywords.cgi'>keywords</a>" [% ', <a href="editkeywords.cgi">keywords</a>'
IF user.groups.editkeywords %] IF user.groups.editkeywords %]
[% " | <a href='sanitycheck.cgi'>Sanity&nbsp;check</a>" [% ' | <a href="sanitycheck.cgi">Sanity&nbsp;check</a>'
IF user.groups.tweakparams %] IF user.groups.tweakparams %]
| <a href="relogin.cgi">Log&nbsp;out</a>&nbsp;[% user.login %] | <a href="relogin.cgi">Log&nbsp;out</a>&nbsp;[% user.login %]

Просмотреть файл

@ -247,7 +247,7 @@
<select name="resolution" onchange="document.forms.changeform.knob[[% knum %]].checked=true"> <select name="resolution" onchange="document.forms.changeform.knob[[% knum %]].checked=true">
[% FOREACH resolution = resolutions %] [% FOREACH resolution = resolutions %]
[% NEXT IF !resolution %] [% NEXT IF !resolution %]
<option value="[% resolution FILTER html %]" [% selected IF resolution == "FIXED" %]> <option value="[% resolution FILTER html %]" [% 'selected="selected"' IF resolution == "FIXED" %]>
[% resolution FILTER html %] [% resolution FILTER html %]
</option> </option>
[% END %] [% END %]

Просмотреть файл

@ -651,8 +651,6 @@ function selectProduct(f) {
</tr> </tr>
</table> </table>
[%# Note: the <form> tag is unclosed at the end of this template %]
[%############################################################################%] [%############################################################################%]
[%# Block for SELECT fields #%] [%# Block for SELECT fields #%]
[%############################################################################%] [%############################################################################%]