* fix style closing tags (</1> should be </b> etc.)
authorteepe <teepe@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 14 Jul 2002 15:09:22 +0000 (15:09 +0000)
committerteepe <teepe@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 14 Jul 2002 15:09:22 +0000 (15:09 +0000)
* prevent ' style="Array"' from the html output

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3095 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/html.class

index 80ab1aa3df3fa34473d4e4d277921c635d013990..60c0c139aae0977cd769bf84f2b8e93776288407 100644 (file)
@@ -118,7 +118,8 @@ class html {
     if ($xtr_prop) {
        echo ' '.$prop;
     }
-    if ($style && !$usecss) {
+    if ($style && !$usecss && !is_array($style)) {
+       /* last premisse is to prevent 'style="Array"' in the output */
        echo ' style="'.$style.'"';  
     }
     if ($javascript) {
@@ -133,7 +134,7 @@ class html {
          echo $text;
           foreach ($style as $k => $v) { /* if value of key value = true close the tag */
            if ($v) {
-               echo '</'.$v.'>';
+               echo '</'.$k.'>';
            }   
          }
        } else {
@@ -148,15 +149,15 @@ class html {
          }
        }
        echo "\n";
-       $indent.='  ';
+       $indentmore = $indent . '  ';
        for($i = 0;$i<$cnt;$i++) {
           $el = $this->html_el[$i];
-         $el->echoHtml($usecss,$indent);
+         $el->echoHtml($usecss,$indentmore);
        }
        if ($style && !$usecss) {       
           foreach ($style as $k => $v) { /* if value of key value = true close the tag */
            if ($v) {
-               echo '</'.$v.'>';
+               echo '</'.$k.'>';
            }   
          }
        }