Explorar el Código

Fix for [ 544658 ] Cross-site scripting vulnerability.

graf25 hace 23 años
padre
commit
9d2dfbb070
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  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 ++;
             }