Add PHP5-style constructor
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 10 Dec 2016 10:29:47 +0000 (10:29 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 10 Dec 2016 10:29:47 +0000 (10:29 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14618 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/mime/ContentType.class.php

index 1919c08280f81f0f9afd1fbef639daa9ee7a5367..86433aa37ba133ac31a3e4d1b16d036c46da37d5 100644 (file)
@@ -41,11 +41,11 @@ 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) {
@@ -56,4 +56,13 @@ class ContentType {
         }
         $this->properties = array();
     }
+
+    /**
+     * 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($name);
+    }
 }