Further XSS improvements plus a bugfix.
[squirrelmail.git] / functions / smtp.php
index d10f6854a45a541b0b6d7b49a86bbe59c395be85..e5f634fc5b6e8d9c791c5290467403272b982b52 100644 (file)
@@ -162,10 +162,10 @@ function attachFiles ($fp, $session, $rn="\r\n") {
                          * Check if the last line has newline ($rn) in it
                          * and append if it doesn't.
                          */
-                        if ($fp && feof($fp) && !strstr($tmp, "$rn")){
+                        if ($file && feof($file) && !strstr($tmp, "$rn")){
                             $tmp .= $rn;
                         }
-                        if ($fp) {
+                        if ($fp) { 
                             fputs($fp, $tmp);
                         }
                         $length += strlen($tmp);