| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Disposition.class.php |
| 5 | * |
| 6 | * This file contains functions needed to handle content disposition headers |
| 7 | * in mime messages. See RFC 2183. |
| 8 | * |
| 9 | * @copyright 2003-2022 The SquirrelMail Project Team |
| 10 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
| 11 | * @version $Id$ |
| 12 | * @package squirrelmail |
| 13 | * @subpackage mime |
| 14 | * @since 1.3.2 |
| 15 | */ |
| 16 | |
| 17 | /** |
| 18 | * Class that handles content disposition header |
| 19 | * @package squirrelmail |
| 20 | * @subpackage mime |
| 21 | * @since 1.3.0 |
| 22 | * @todo FIXME: do we have to declare vars ($name and $properties)? |
| 23 | */ |
| 24 | class Disposition { |
| 25 | /** |
| 26 | * Constructor (PHP5 style, required in some future version of PHP) |
| 27 | * @param string $name |
| 28 | */ |
| 29 | function __construct($name) { |
| 30 | $this->name = $name; |
| 31 | $this->properties = array(); |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Constructor (PHP4 style, kept for compatibility reasons) |
| 36 | * @param string $name |
| 37 | */ |
| 38 | function Disposition($name) { |
| 39 | self::__construct($name); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Returns value of content disposition property |
| 44 | * @param string $par content disposition property name |
| 45 | * @return string |
| 46 | * @since 1.3.1 |
| 47 | */ |
| 48 | function getProperty($par) { |
| 49 | $par = strtolower($par); |
| 50 | if (isset($this->properties[$par])) { |
| 51 | return $this->properties[$par]; |
| 52 | } |
| 53 | return ''; |
| 54 | } |
| 55 | } |