Przeglądaj źródła

Fixed XSS vulnarability in decodeHeader function spotted by Joost Pol

stekkel 21 lat temu
rodzic
commit
c903e1f8c6
1 zmienionych plików z 5 dodań i 1 usunięć
  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 */