Happy New Year
[squirrelmail.git] / class / mime / ContentType.class.php
index d44c79f9ccf4fd8baa11a033fea1dbd463087d9a..073b6d6cf321ce6da740395b43adcf0efe4c4367 100644 (file)
@@ -3,12 +3,11 @@
 /**
  * ContentType.class.php
  *
- * Copyright (c) 2003-2005 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
  * This file contains functions needed to handle content type headers 
  * (rfc2045) in mime messages.
  *
+ * @copyright 2003-2018 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
  * @subpackage mime
@@ -42,11 +41,12 @@ class ContentType {
     var $properties = '';
 
     /**
-     * Constructor function.
+     * Constructor (PHP5 style, required in some future version of PHP)
      * Prepared type0 and type1 properties
      * @param string $type content type string without auxiliary information
      */
-    function ContentType($type) {
+    function __construct($type) {
+        $type = strtolower($type);
         $pos = strpos($type, '/');
         if ($pos > 0) {
             $this->type0 = substr($type, 0, $pos);
@@ -56,6 +56,13 @@ class ContentType {
         }
         $this->properties = array();
     }
-}
 
-?>
\ No newline at end of file
+    /**
+     * Constructor (PHP4 style, kept for compatibility reasons)
+     * Prepared type0 and type1 properties
+     * @param string $type content type string without auxiliary information
+     */
+    function ContentType($type) {
+       self::__construct($type);
+    }
+}