Browse Source

Fix for [ 544658 ] Cross-site scripting vulnerability.

graf25 23 years ago
parent
commit
9d2dfbb070
1 changed files with 5 additions and 1 deletions
  1. 5 1
      functions/mime.php

+ 5 - 1
functions/mime.php

@@ -1085,12 +1085,16 @@ function MagicHTML( $body, $id ) {
             $pos = $i + 1;
             $tag = '';
             while ($body{$pos} == ' ' || $body{$pos} == "\t" ||
-                   $body{$pos} == "\n" ) {
+                   $body{$pos} == "\n") {
                 $pos ++;
             }
             while (strlen($tag) < 4 && $body{$pos} != ' ' &&
                    $body{$pos} != "\t" && $body{$pos} != "\n" &&
                    $pos < $j ) {
+                if ($body{$pos} == "<"){
+                    $tag = '';
+                    $pos++;
+                }
                 $tag .= $body{$pos};
                 $pos ++;
             }