View Issue Details

IDProjectCategoryView StatusLast Update
0005547mantisbtotherpublic2005-05-31 11:33
Reporterryandesign Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.0.0a2 
Fixed in Version1.0.0a3 
Summary0005547: Problem with non-escaped "</" in inline JavaScript code (patch)
Description

There are two places where I found inline JavaScript code like this used:

<script type="text/javascript" language="JavaScript">
if (document.layers) {
document.write('<style>td{padding:0px;}</style>')
}
</script>

The problem is that the spec says that the first occurrence of the string "</" after a <script> tag ends the script tag. Of course no browsers I know of actually interpret it this way, but it's still flagged as an error by HTML validators. The attached patch fixes it.

TagsNo tags attached.
Attached Files
js_css.patch (976 bytes)   
Index: admin/css/css_inc.php
===================================================================
--- admin/css/css_inc.php	(revision 12)
+++ admin/css/css_inc.php	(working copy)
@@ -106,7 +106,7 @@
 <!-- For Netscape 4.x -->
 <script type="text/javascript" language="JavaScript">
 if (document.layers) {
-	document.write('<style>td{padding:0px;}</style>')
+	document.write('<style>td{padding:0px;}<\/style>')
 }
 </script>
 <noscript></noscript>
Index: core/html_api.php
===================================================================
--- core/html_api.php	(revision 16)
+++ core/html_api.php	(working copy)
@@ -211,7 +211,7 @@
 
 		# fix for NS 4.x css
 		echo "\t", '<script type="text/javascript" language="JavaScript"><!--', "\n";
-		echo "\t\t", 'if(document.layers) {document.write("<style>td{padding:0px;}</style>")}', "\n";
+		echo "\t\t", 'if(document.layers) {document.write("<style>td{padding:0px;}<\/style>")}', "\n";
 		echo "\t", '--></script>', "\n";
 	}
 
js_css.patch (976 bytes)   

Activities