Explorar o código

Fixed XSS vulnarability in decodeHeader function spotted by Joost Pol

stekkel %!s(int64=21) %!d(string=hai) anos
pai
achega
c903e1f8c6
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      functions/mime.php

+ 5 - 1
functions/mime.php

@@ -659,7 +659,11 @@ function decodeHeader ($string, $utfencode=true,$htmlsave=true,$decide=false) {
             }
             $iLastMatch = $i;
             $j = $i;
-            $ret .= $res[1];
+            if ($htmlsave) {
+                $ret .= htmlspecialchars($res[1]);
+            } else {
+                $ret .= $res[1];
+            }
             $encoding = ucfirst($res[3]);
 
             /* decide about valid decoding */