Fixed case where HTML comments were getting stripped when opening tag not followed by whitespace (<!--foo--> was stripped, <!-- foo --> was not, neither is stripped now)
authorDan
Mon, 28 Jan 2008 23:07:32 -0500
changeset 279 b6faa6d6ade2
parent 278 2c6ef58e315a
child 280 7b984f924dcd
child 281 881b77f880fb
Fixed case where HTML comments were getting stripped when opening tag not followed by whitespace (<!--foo--> was stripped, <!-- foo --> was not, neither is stripped now)
includes/template.php
--- a/includes/template.php	Mon Jan 28 23:06:38 2008 -0500
+++ b/includes/template.php	Mon Jan 28 23:07:32 2008 -0500
@@ -153,36 +153,7 @@
     {
       $this->add_header('
         <!--[if lt IE 7]>
-        <script language="JavaScript">
-        function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
-        {
-           var arVersion = navigator.appVersion.split("MSIE");
-           var version = parseFloat(arVersion[1]);
-           if (version >= 5.5 && typeof(document.body.filters) == "object")
-           {
-              for(var i=0; i<document.images.length; i++)
-              {
-                 var img = document.images[i];
-                 continue;
-                 var imgName = img.src.toUpperCase();
-                 if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
-                 {
-                    var imgID = (img.id) ? "id=\'" + img.id + "\' " : "";
-                    var imgClass = (img.className) ? "class=\'" + img.className + "\' " : "";
-                    var imgTitle = (img.title) ? "title=\'" + img.title + "\' " : "title=\'" + img.alt + "\' ";
-                    var imgStyle = "display:inline-block;" + img.style.cssText;
-                    if (img.align == "left") imgStyle = "float:left;" + imgStyle;
-                    if (img.align == "right") imgStyle = "float:right;" + imgStyle;
-                    if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
-                    var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\\\'" + img.src + "\\\', sizingMethod=\'scale\');\\"></span>";
-                    img.outerHTML = strNewHTML;
-                    i = i-1;
-                 }
-              }
-           }   
-        }
-        window.attachEvent("onload", correctPNG);
-        </script>
+        <script type="text/javascript" src="' . scriptPath . '/includes/clientside/ie-png.js"></script>
         <![endif]-->
         ');
     }
@@ -907,7 +878,7 @@
     // This is a bad coding practice so this function will always be picky.
     if ( !$this->theme )
     {
-      die('$template->extract_vars(): theme not yet loaded, so we can\'t open template files yet...this is a bug and should be reported.<br /><br />Backtrace, most recent call first:<pre>'.enano_debug_print_backtrace(true).'</pre>');
+      die('$template->extract_vars(): theme (' . $this->theme . ') not yet loaded, so we can\'t open template files yet...this is a bug and should be reported.<br /><br />Backtrace, most recent call first:<pre>'.enano_debug_print_backtrace(true).'</pre>');
     }
     
     // Full pathname of template file
@@ -1072,7 +1043,7 @@
     //
     
     // System messages
-    $text = preg_replace('/<!-- SYSMSG ([A-z0-9\._-]+?) -->/is', '\' . $this->tplWikiFormat($paths->sysMsg(\'\\1\')) . \'', $text);
+    $text = preg_replace('/<!-- SYSMSG ([A-z0-9\._-]+?) -->/is', '\' . $template->tplWikiFormat($paths->sysMsg(\'\\1\')) . \'', $text);
     
     // Template variables
     $text = preg_replace('/\{([A-z0-9_-]+?)\}/is', '\' . $this->tpl_strings[\'\\1\'] . \'', $text);