X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=class%2Fmime%2FContentType.class.php;h=1287bb3a7b9183b09f12ad444010decab234c693;hb=22387c8d44f3ab104db6e19180d3775a45762359;hp=85f24ab761fe3274d1ee88d8c57444772870cd81;hpb=76911253eb850bacde3d86c8cb7b4af072e67ebe;p=squirrelmail.git diff --git a/class/mime/ContentType.class.php b/class/mime/ContentType.class.php index 85f24ab7..1287bb3a 100644 --- a/class/mime/ContentType.class.php +++ b/class/mime/ContentType.class.php @@ -3,20 +3,50 @@ /** * ContentType.class.php * - * Copyright (c) 2003 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. * - * This contains functions needed to handle mime messages. - * - * $Id$ + * @copyright 2003-2017 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ + * @package squirrelmail + * @subpackage mime + * @since 1.3.2 */ +/** + * Class that handles content-type headers + * Class was named content_type in 1.3.0 and 1.3.1. It is used internally + * by rfc822header class. + * @package squirrelmail + * @subpackage mime + * @since 1.3.2 + */ class ContentType { - var $type0 = 'text', - $type1 = 'plain', - $properties = ''; + /** + * Media type + * @var string + */ + var $type0 = 'text'; + /** + * Media subtype + * @var string + */ + var $type1 = 'plain'; + /** + * Auxiliary header information + * prepared with parseContentType() function in rfc822header class. + * @var array + */ + var $properties = ''; - function ContentType($type) { + /** + * 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 __construct($type) { + $type = strtolower($type); $pos = strpos($type, '/'); if ($pos > 0) { $this->type0 = substr($type, 0, $pos); @@ -26,6 +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($type); + } +}