浏览代码

Fix for [ 544658 ] Cross-site scripting vulnerability.

graf25 23 年之前
父节点
当前提交
9d2dfbb070
共有 1 个文件被更改,包括 5 次插入1 次删除
  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 ++;
             }