浏览代码

$this->content_type == '' test causes E_NOTICE in php 5.1, when
$this->content_type is object. content_type should always store ContentType
object and this code is only to make sure that parameter is not default
string.

tokul 19 年之前
父节点
当前提交
9d85fd232c
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      class/mime/Rfc822Header.class.php

+ 3 - 2
class/mime/Rfc822Header.class.php

@@ -88,7 +88,8 @@ class Rfc822Header {
      */
     var $mime = false;
     /**
-     * @var mixed
+     * Content Type object
+     * @var object
      */
     var $content_type = '';
     /**
@@ -156,7 +157,7 @@ class Rfc822Header {
                 }
             }
         }
-        if ($this->content_type == '') {
+        if (!is_object($this->content_type)) {
             $this->parseContentType('text/plain; charset=us-ascii');
         }
     }