X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=class%2Fmime%2FContentType.class.php;h=347d5b18e2d6d251c81c1187691cae66291bf579;hb=77e3ccf6cec41d76af875009610614e4216f63d3;hp=9653b58f1d0a85788f1935619d711a36a5f5ecc9;hpb=6c84ba1ec45ab854c37b6f65c5b4d84ab1c7aad4;p=squirrelmail.git diff --git a/class/mime/ContentType.class.php b/class/mime/ContentType.class.php index 9653b58f..347d5b18 100644 --- a/class/mime/ContentType.class.php +++ b/class/mime/ContentType.class.php @@ -3,25 +3,50 @@ /** * ContentType.class.php * - * Copyright (c) 2003-2005 The SquirrelMail Project Team - * Licensed under the GNU GPL. For full terms see the file COPYING. - * - * This contains functions needed to handle mime messages. + * This file contains functions needed to handle content type headers + * (rfc2045) in mime messages. * + * @copyright 2003-2016 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 */ /** - * Undocumented class + * 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); @@ -31,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); + } +}