| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
class Mime { |
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
* Utilisé dans la méthode Mime::encodeHeader() pour détecter |
|---|
| 46 |
* si un octet donné est le début d’une séquence d’octets utf-8 |
|---|
| 47 |
* |
|---|
| 48 |
* @static |
|---|
| 49 |
* @var array |
|---|
| 50 |
* @access private |
|---|
| 51 |
*/ |
|---|
| 52 |
private static $_utf8test = array( |
|---|
| 53 |
0x80 => 0, 0xE0 => 0xC0, 0xF0 => 0xE0, 0xF8 => 0xF0, 0xFC => 0xF8, 0xFE => 0xFC |
|---|
| 54 |
); |
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
* Encode le texte au format quoted-printable tel que défini dans la RFC 2045 |
|---|
| 58 |
* |
|---|
| 59 |
* @see RFC 2045 (sec. 6.7) |
|---|
| 60 |
* |
|---|
| 61 |
* @param string $str |
|---|
| 62 |
* |
|---|
| 63 |
* @static |
|---|
| 64 |
* @access public |
|---|
| 65 |
* @return string |
|---|
| 66 |
*/ |
|---|
| 67 |
public static function quotedPrintableEncode($str) |
|---|
| 68 |
{ |
|---|
| 69 |
$str = preg_replace('/\r\n?|\n/', "\r\n", $str); |
|---|
| 70 |
$str = preg_replace('/([^\x09\x0A\x0D\x20-\x3C\x3E-\x7E]|[\x09\x20](?=\x0D\x0A|$))/e', |
|---|
| 71 |
'sprintf(\'=%02X\', ord("\\1"));', $str); |
|---|
| 72 |
|
|---|
| 73 |
$maxlen = 76; |
|---|
| 74 |
$lines = explode("\r\n", $str); |
|---|
| 75 |
|
|---|
| 76 |
foreach( $lines as &$line ) { |
|---|
| 77 |
if( ($strlen = strlen($line)) == 0 ) { |
|---|
| 78 |
continue; |
|---|
| 79 |
} |
|---|
| 80 |
|
|---|
| 81 |
$newline = ''; |
|---|
| 82 |
$pos = 0; |
|---|
| 83 |
|
|---|
| 84 |
while( $pos < $strlen ) { |
|---|
| 85 |
$tmplen = $maxlen; |
|---|
| 86 |
$i = min(($pos + $tmplen), $strlen); |
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
// le signe égal, "soft break" |
|---|
| 90 |
if( $i < $strlen ) { |
|---|
| 91 |
$tmplen--; |
|---|
| 92 |
$i--; |
|---|
| 93 |
} |
|---|
| 94 |
|
|---|
| 95 |
while( $line{$i-1} == '=' || $line{$i-2} == '=' ) { |
|---|
| 96 |
$tmplen--; |
|---|
| 97 |
$i--; |
|---|
| 98 |
} |
|---|
| 99 |
|
|---|
| 100 |
$newline .= substr($line, $pos, $tmplen) . "=\r\n"; |
|---|
| 101 |
$pos += $tmplen; |
|---|
| 102 |
} |
|---|
| 103 |
|
|---|
| 104 |
$line = rtrim($newline, "=\r\n"); |
|---|
| 105 |
} |
|---|
| 106 |
|
|---|
| 107 |
return implode("\r\n", $lines); |
|---|
| 108 |
} |
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 |
* Encode la valeur d’un en-tête si elle contient des caractères non-ascii. |
|---|
| 112 |
* Autrement, des guillemets peuvent néanmoins être ajoutés aux extrémités |
|---|
| 113 |
* si des caractères interdits pour le token considéré sont présents. |
|---|
| 114 |
* |
|---|
| 115 |
* @param string $header Nom de l’en-tête concerné |
|---|
| 116 |
* @param string $header Valeur d’en-tête à encoder |
|---|
| 117 |
* @param string $charset Jeu de caractères utilisé |
|---|
| 118 |
* @param string $token |
|---|
| 119 |
* |
|---|
| 120 |
* @static |
|---|
| 121 |
* @access public |
|---|
| 122 |
* @return string |
|---|
| 123 |
*/ |
|---|
| 124 |
public static function encodeHeader($name, $value, $charset, $token = 'text') |
|---|
| 125 |
{ |
|---|
| 126 |
if( preg_match('/[\x00-\x1F\x7F-\xFF]/', $value) ) { |
|---|
| 127 |
|
|---|
| 128 |
$maxlen = 76; |
|---|
| 129 |
$sep = "\r\n\t"; |
|---|
| 130 |
|
|---|
| 131 |
switch( $token ) { |
|---|
| 132 |
case 'comment': |
|---|
| 133 |
$charlist = '\x00-\x1F\x22\x28\x29\x3A\x3D\x3F\x5F\x7F-\xFF'; |
|---|
| 134 |
break; |
|---|
| 135 |
case 'phrase': |
|---|
| 136 |
$charlist = '\x00-\x1F\x22-\x29\x2C\x2E\x3A\x40\x5B-\x60\x7B-\xFF'; |
|---|
| 137 |
break; |
|---|
| 138 |
case 'text': |
|---|
| 139 |
default: |
|---|
| 140 |
$charlist = '\x00-\x1F\x3A\x3D\x3F\x5F\x7F-\xFF'; |
|---|
| 141 |
break; |
|---|
| 142 |
} |
|---|
| 143 |
|
|---|
| 144 |
|
|---|
| 145 |
* Si le nombre d’octets à encoder représente plus de 33% de la chaîne, |
|---|
| 146 |
* nous utiliserons l’encodage base64 qui garantit une chaîne encodée 33% |
|---|
| 147 |
* plus longue que l’originale, sinon, on utilise l’encodage "Q". |
|---|
| 148 |
* La RFC 2047 recommande d’utiliser pour chaque cas l’encodage produisant |
|---|
| 149 |
* le résultat le plus court. |
|---|
| 150 |
* |
|---|
| 151 |
* @see RFC 2045#6.8 |
|---|
| 152 |
* @see RFC 2047#4 |
|---|
| 153 |
*/ |
|---|
| 154 |
$q = preg_match_all("/[$charlist]/", $value, $matches); |
|---|
| 155 |
$strlen = strlen($value); |
|---|
| 156 |
$encoding = (($q / $strlen) < 0.33) ? 'Q' : 'B'; |
|---|
| 157 |
$template = sprintf('=?%s?%s?%%s?=%s', $charset, $encoding, $sep); |
|---|
| 158 |
$maxlen = ($maxlen - strlen($template) + strlen($sep) + 2); |
|---|
| 159 |
$is_utf8 = (strcasecmp($charset, 'UTF-8') == 0); |
|---|
| 160 |
$newbody = ''; |
|---|
| 161 |
$pos = 0; |
|---|
| 162 |
|
|---|
| 163 |
while( $pos < $strlen ) { |
|---|
| 164 |
$tmplen = $maxlen; |
|---|
| 165 |
if( $newbody == '' ) { |
|---|
| 166 |
$tmplen -= strlen($name . ': '); |
|---|
| 167 |
if( $encoding == 'Q' ) $tmplen++; |
|---|
| 168 |
} |
|---|
| 169 |
|
|---|
| 170 |
if( $encoding == 'Q' ) { |
|---|
| 171 |
$q = preg_match_all("/[$charlist]/", substr($value, $pos, $tmplen), $matches); |
|---|
| 172 |
|
|---|
| 173 |
// la chaîne encodée. On retranche cette valeur de la longueur du tronçon |
|---|
| 174 |
$tmplen -= ($q * 2); |
|---|
| 175 |
} |
|---|
| 176 |
else { |
|---|
| 177 |
|
|---|
| 178 |
* La longueur de l'encoded-text' doit être un multiple de 4 |
|---|
| 179 |
* pour ne pas casser l’encodage base64 |
|---|
| 180 |
* |
|---|
| 181 |
* @see RFC 2047#5 |
|---|
| 182 |
*/ |
|---|
| 183 |
$tmplen -= ($tmplen % 4); |
|---|
| 184 |
$tmplen = floor(($tmplen/4)*3); |
|---|
| 185 |
} |
|---|
| 186 |
|
|---|
| 187 |
if( $is_utf8 ) { |
|---|
| 188 |
|
|---|
| 189 |
* Il est interdit de sectionner un caractère multi-octet. |
|---|
| 190 |
* On teste chaque octet en partant de la fin du tronçon en cours |
|---|
| 191 |
* jusqu’à tomber sur un caractère ascii ou l’octet de début de |
|---|
| 192 |
* séquence d’un caractère multi-octets. |
|---|
| 193 |
* On vérifie alors qu’il y bien $m octets qui suivent (le cas échéant). |
|---|
| 194 |
* Si ce n’est pas le cas, on réduit la longueur du tronçon. |
|---|
| 195 |
* |
|---|
| 196 |
* @see RFC 2047#5 |
|---|
| 197 |
*/ |
|---|
| 198 |
for( $i = min(($pos + $tmplen), $strlen), $c = 1; $i > $pos; $i--, $c++ ) { |
|---|
| 199 |
$d = ord($value{$i-1}); |
|---|
| 200 |
|
|---|
| 201 |
reset(self::$_utf8test); |
|---|
| 202 |
for( $m = 1; $m <= 6; $m++ ) { |
|---|
| 203 |
$test = each(self::$_utf8test); |
|---|
| 204 |
if( ($d & $test[0]) == $test[1] ) { |
|---|
| 205 |
if( $c < $m ) { |
|---|
| 206 |
$tmplen -= $c; |
|---|
| 207 |
} |
|---|
| 208 |
break 2; |
|---|
| 209 |
} |
|---|
| 210 |
} |
|---|
| 211 |
} |
|---|
| 212 |
} |
|---|
| 213 |
|
|---|
| 214 |
$tmp = substr($value, $pos, $tmplen); |
|---|
| 215 |
if( $encoding == 'Q' ) { |
|---|
| 216 |
$tmp = preg_replace("/([$charlist])/e", 'sprintf(\'=%02X\', ord("\\1"));', $tmp); |
|---|
| 217 |
$tmp = str_replace(' ', '_', $tmp); |
|---|
| 218 |
} |
|---|
| 219 |
else { |
|---|
| 220 |
$tmp = base64_encode($tmp); |
|---|
| 221 |
} |
|---|
| 222 |
|
|---|
| 223 |
$newbody .= sprintf($template, $tmp); |
|---|
| 224 |
$pos += $tmplen; |
|---|
| 225 |
} |
|---|
| 226 |
|
|---|
| 227 |
$value = rtrim($newbody); |
|---|
| 228 |
} |
|---|
| 229 |
else if( $token != 'text' ) { |
|---|
| 230 |
if( preg_match('/[^!#$%&\'*+\/0-9=?a-z^_`{|}~-]/', $value) ) { |
|---|
| 231 |
$value = '"'.$value.'"'; |
|---|
| 232 |
} |
|---|
| 233 |
} |
|---|
| 234 |
|
|---|
| 235 |
return $value; |
|---|
| 236 |
} |
|---|
| 237 |
|
|---|
| 238 |
|
|---|
| 239 |
* @param string $str |
|---|
| 240 |
* @param integer $maxlen |
|---|
| 241 |
* |
|---|
| 242 |
* @static |
|---|
| 243 |
* @access public |
|---|
| 244 |
* @return string |
|---|
| 245 |
*/ |
|---|
| 246 |
public static function wordwrap($str, $maxlen = 78) |
|---|
| 247 |
{ |
|---|
| 248 |
if( strlen($str) > $maxlen ) { |
|---|
| 249 |
$lines = explode("\r\n", $str); |
|---|
| 250 |
foreach( $lines as &$line ) { |
|---|
| 251 |
$line = wordwrap($line, $maxlen, "\r\n"); |
|---|
| 252 |
} |
|---|
| 253 |
$str = implode("\r\n", $lines); |
|---|
| 254 |
} |
|---|
| 255 |
|
|---|
| 256 |
return $str; |
|---|
| 257 |
} |
|---|
| 258 |
|
|---|
| 259 |
|
|---|
| 260 |
* @param string $filename |
|---|
| 261 |
* |
|---|
| 262 |
* @static |
|---|
| 263 |
* @access public |
|---|
| 264 |
* @return string |
|---|
| 265 |
*/ |
|---|
| 266 |
public static function getType($filename) |
|---|
| 267 |
{ |
|---|
| 268 |
if( !is_readable($filename) ) { |
|---|
| 269 |
throw new Exception("Cannot read file '$filename'"); |
|---|
| 270 |
} |
|---|
| 271 |
|
|---|
| 272 |
if( extension_loaded('fileinfo') ) { |
|---|
| 273 |
$info = new finfo(FILEINFO_MIME); |
|---|
| 274 |
$type = $info->file($filename); |
|---|
| 275 |
} |
|---|
| 276 |
else if( function_exists('exec') ) { |
|---|
| 277 |
$type = exec(sprintf('file -biL %s 2>/dev/null', |
|---|
| 278 |
escapeshellarg($filename)), $null, $result); |
|---|
| 279 |
|
|---|
| 280 |
if( $result !== 0 || !strpos($type, '/') ) { |
|---|
| 281 |
$type = ''; |
|---|
| 282 |
} |
|---|
| 283 |
|
|---|
| 284 |
|
|---|
| 285 |
|
|---|
| 286 |
|
|---|
| 287 |
|
|---|
| 288 |
} |
|---|
| 289 |
extension_loaded('mime_magic') ) { |
|---|
| 290 |
$type = mime_content_type($filename); |
|---|
| 291 |
|
|---|
| 292 |
|
|---|
| 293 |
$type) ) { |
|---|
| 294 |
$type = 'application/octet-stream'; |
|---|
| 295 |
|
|---|
| 296 |
|
|---|
| 297 |
trim($type); |
|---|
| 298 |
|
|---|
| 299 |
|
|---|
| 300 |
|
|---|
| 301 |
Mime_Part { |
|---|
| 302 |
|
|---|
| 303 |
|
|---|
| 304 |
|
|---|
| 305 |
|
|---|
| 306 |
|
|---|
| 307 |
|
|---|
| 308 |
|
|---|
| 309 |
|
|---|
| 310 |
public $headers = null; |
|---|
| 311 |
|
|---|
| 312 |
|
|---|
| 313 |
|
|---|
| 314 |
|
|---|
| 315 |
|
|---|
| 316 |
|
|---|
| 317 |
|
|---|
| 318 |
public $body = null; |
|---|
| 319 |
|
|---|
| 320 |
|
|---|
| 321 |
|
|---|
| 322 |
|
|---|
| 323 |
|
|---|
| 324 |
|
|---|
| 325 |
|
|---|
| 326 |
private $subparts = array(); |
|---|
| 327 |
|
|---|
| 328 |
|
|---|
| 329 |
|
|---|
| 330 |
|
|---|
| 331 |
|
|---|
| 332 |
|
|---|
| 333 |
|
|---|
| 334 |
private $boundary = null; |
|---|
| 335 |
|
|---|
| 336 |
|
|---|
| 337 |
|
|---|
| 338 |
|
|---|
| 339 |
|
|---|
| 340 |
|
|---|
| 341 |
|
|---|
| 342 |
|
|---|
| 343 |
|
|---|
| 344 |
|
|---|
| 345 |
|
|---|
| 346 |
public $wraptext = true; |
|---|
| 347 |
|
|---|
| 348 |
|
|---|
| 349 |
|
|---|
| 350 |
|
|---|
| 351 |
|
|---|
| 352 |
|
|---|
| 353 |
|
|---|
| 354 |
|
|---|
| 355 |
|
|---|
| 356 |
public function __construct($body = null, $headers = null) |
|---|
| 357 |
|
|---|
| 358 |
$this->headers = new Mime_Headers($headers); |
|---|
| 359 |
|
|---|
| 360 |
is_null($body) ) { |
|---|
| 361 |
$this->body = $body; |
|---|
| 362 |
|
|---|
| 363 |
|
|---|
| 364 |
|
|---|
| 365 |
|
|---|
| 366 |
|
|---|
| 367 |
|
|---|
| 368 |
|
|---|
| 369 |
|
|---|
| 370 |
|
|---|
| 371 |
|
|---|
| 372 |
|
|---|
| 373 |
|
|---|
| 374 |
public function addSubPart($subpart) |
|---|
| 375 |
|
|---|
| 376 |
is_array($subpart) ) { |
|---|
| 377 |
$this->subparts = array_merge($this->subparts, $subpart); |
|---|
| 378 |
|
|---|
| 379 |
|
|---|
| 380 |
array_push($this->subparts, $subpart); |
|---|
| 381 |
|
|---|
| 382 |
|
|---|
| 383 |
|
|---|
| 384 |
|
|---|
| 385 |
|
|---|
| 386 |
|
|---|
| 387 |
|
|---|
| 388 |
|
|---|
| 389 |
|
|---|
| 390 |
public function isMultiPart() |
|---|
| 391 |
|
|---|
| 392 |
count($this->subparts) > 0; |
|---|
| 393 |
|
|---|
| 394 |
|
|---|
| 395 |
|
|---|
| 396 |
|
|---|
| 397 |
|
|---|
| 398 |
|
|---|
| 399 |
public function __toString() |
|---|
| 400 |
|
|---|
| 401 |
$this->headers->get('Content-Type') == null ) { |
|---|
| 402 |
$this->headers->set('Content-Type', 'application/octet-stream'); |
|---|
| 403 |
|
|---|
| 404 |
|
|---|
| 405 |
$body = $this->body; |
|---|
| 406 |
|
|---|
| 407 |
$this->isMultiPart() ) { |
|---|
| 408 |
$this->boundary = '--=_Part_' . md5(microtime()); |
|---|
| 409 |
$this->headers->get('Content-Type')->param('boundary', $this->boundary); |
|---|
| 410 |
|
|---|
| 411 |
$body != '' ) { |
|---|
| 412 |
$body .= "\r\n\r\n"; |
|---|
| 413 |
|
|---|
| 414 |
|
|---|
| 415 |
$this->subparts as $subpart ) { |
|---|
| 416 |
$body .= '--' . $this->boundary . "\r\n"; |
|---|
| 417 |
$body .= !is_string($subpart) ? $subpart->__toString() : $subpart; |
|---|
| 418 |
$body .= "\r\n"; |
|---|
| 419 |
|
|---|
| 420 |
|
|---|
| 421 |
$body .= '--' . $this->boundary . "--\r\n"; |
|---|
| 422 |
|
|---|
| 423 |
|
|---|
| 424 |
$encoding = $this->headers->get('Content-Transfer-Encoding') ) { |
|---|
| 425 |
$encoding = strtolower($encoding->value); |
|---|
| 426 |
|
|---|
| 427 |
|
|---|
| 428 |
in_array($encoding, array('7bit', '8bit', 'quoted-printable', 'base64', 'binary')) ) { |
|---|
| 429 |
$this->headers->remove('Content-Transfer-Encoding'); |
|---|
| 430 |
$encoding = '7bit'; |
|---|
| 431 |
|
|---|
| 432 |
|
|---|
| 433 |
$encoding ) { |
|---|
| 434 |
'quoted-printable': |
|---|
| 435 |
|
|---|
| 436 |
|
|---|
| 437 |
|
|---|
| 438 |
|
|---|
| 439 |
|
|---|
| 440 |
$body = Mime::quotedPrintableEncode($body); |
|---|
| 441 |
|
|---|
| 442 |
'base64': |
|---|
| 443 |
|
|---|
| 444 |
|
|---|
| 445 |
|
|---|
| 446 |
|
|---|
| 447 |
|
|---|
| 448 |
$body = rtrim(chunk_split(base64_encode($body))); |
|---|
| 449 |
|
|---|
| 450 |
'7bit': |
|---|
| 451 |
'8bit': |
|---|
| 452 |
$body = preg_replace("/\r\n?|\n/", "\r\n", $body); |
|---|
| 453 |
|
|---|
| 454 |
|
|---|
| 455 |
|
|---|
| 456 |
|
|---|
| 457 |
|
|---|
| 458 |
|
|---|
| 459 |
|
|---|
| 460 |
|
|---|
| 461 |
|
|---|
| 462 |
$body = Mime::wordwrap($body, $this->wraptext ? 78 : 998); |
|---|
| 463 |
|
|---|
| 464 |
|
|---|
| 465 |
|
|---|
| 466 |
|
|---|
| 467 |
$this->headers->__toString() . "\r\n" . $body; |
|---|
| 468 |
|
|---|
| 469 |
|
|---|
| 470 |
__set($name, $value) |
|---|
| 471 |
|
|---|
| 472 |
$name == 'encoding' ) { |
|---|
| 473 |
$this->headers->set('Content-Transfer-Encoding', $value); |
|---|
| 474 |
|
|---|
| 475 |
|
|---|
| 476 |
|
|---|
| 477 |
__get($name) |
|---|
| 478 |
|
|---|
| 479 |
$value = null; |
|---|
| 480 |
|
|---|
| 481 |
$name == 'encoding' ) { |
|---|
| 482 |
$encoding = $this->headers->get('Content-Transfer-Encoding') ) { |
|---|
| 483 |
$value = $encoding->value; |
|---|
| 484 |
|
|---|
| 485 |
|
|---|
| 486 |
$value = '7bit'; |
|---|
| 487 |
|
|---|
| 488 |
|
|---|
| 489 |
|
|---|
| 490 |
$value; |
|---|
| 491 |
|
|---|
| 492 |
|
|---|
| 493 |
__clone() |
|---|
| 494 |
|
|---|
| 495 |
$this->headers = clone $this->headers; |
|---|
| 496 |
|
|---|
| 497 |
is_array($this->subparts) ) { |
|---|
| 498 |
$this->subparts as &$subpart ) { |
|---|
| 499 |
$subpart = clone $subpart; |
|---|
| 500 |
|
|---|
| 501 |
|
|---|
| 502 |
|
|---|
| 503 |
|
|---|
| 504 |
|
|---|
| 505 |
Mime_Headers implements Iterator { |
|---|
| 506 |
|
|---|
| 507 |
|
|---|
| 508 |
|
|---|
| 509 |
|
|---|
| 510 |
|
|---|
| 511 |
|
|---|
| 512 |
|
|---|
| 513 |
private $headers = array(); |
|---|
| 514 |
|
|---|
| 515 |
$_it_tot = 0; |
|---|
| 516 |
$_it_ind = 0; |
|---|
| 517 |
$_it_obj = null; |
|---|
| 518 |
|
|---|
| 519 |
|
|---|
| 520 |
|
|---|
| 521 |
|
|---|
| 522 |
|
|---|
| 523 |
|
|---|
| 524 |
|
|---|
| 525 |
|
|---|
| 526 |
|
|---|
| 527 |
public function __construct($headers = null) |
|---|
| 528 |
|
|---|
| 529 |
is_array($headers) ) { |
|---|
| 530 |
$headers as $name => $value ) { |
|---|
| 531 |
$this->add($name, $value); |
|---|
| 532 |
|
|---|
| 533 |
|
|---|
| 534 |
|
|---|
| 535 |
|
|---|
| 536 |
|
|---|
| 537 |
|
|---|
| 538 |
|
|---|
| 539 |
|
|---|
| 540 |
|
|---|
| 541 |
|
|---|
| 542 |
|
|---|
| 543 |
|
|---|
| 544 |
|
|---|
| 545 |
public function add($name, $value) |
|---|
| 546 |
|
|---|
| 547 |
$header = new Mime_Header($name, $value); |
|---|
| 548 |
$name = strtolower($header->name); |
|---|
| 549 |
|
|---|
| 550 |
$this->get($name) != null ) { |
|---|
| 551 |
is_array($this->headers[$name]) ) { |
|---|
| 552 |
$this->headers[$name] = array($this->headers[$name]); |
|---|
| 553 |
|
|---|
| 554 |
|
|---|
| 555 |
array_push($this->headers[$name], $header); |
|---|
| 556 |
|
|---|
| 557 |
|
|---|
| 558 |
$this->headers[$name] = $header; |
|---|
| 559 |
|
|---|
| 560 |
|
|---|
| 561 |
$header; |
|---|
| 562 |
|
|---|
| 563 |
|
|---|
| 564 |
|
|---|
| 565 |
|
|---|
| 566 |
|
|---|
| 567 |
|
|---|
| 568 |
|
|---|