@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | if ($prev_header !== null) { |
| 193 | 193 | $headers[$prev_header][] = $line; |
| 194 | 194 | } |
| 195 | - }elseif (substr($line, 0, 1) === " ") { |
|
| 195 | + } elseif (substr($line, 0, 1) === " ") { |
|
| 196 | 196 | $line = substr($line, 1); |
| 197 | 197 | $line = trim(rtrim($line)); |
| 198 | 198 | if ($prev_header !== null) { |
@@ -201,11 +201,11 @@ discard block |
||
| 201 | 201 | } |
| 202 | 202 | if (is_array($headers[$prev_header])) { |
| 203 | 203 | $headers[$prev_header][] = $line; |
| 204 | - }else{ |
|
| 204 | + } else{ |
|
| 205 | 205 | $headers[$prev_header] .= $line; |
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | - }else{ |
|
| 208 | + } else{ |
|
| 209 | 209 | if (($pos = strpos($line, ":")) > 0) { |
| 210 | 210 | $key = trim(rtrim(strtolower(substr($line, 0, $pos)))); |
| 211 | 211 | $key = str_replace("-", "_", $key); |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $value = trim(rtrim(substr($line, $pos + 1))); |
| 214 | 214 | if (isset($headers[$key])) { |
| 215 | 215 | $headers[$key][] = $value; |
| 216 | - }else{ |
|
| 216 | + } else{ |
|
| 217 | 217 | $headers[$key] = [$value]; |
| 218 | 218 | } |
| 219 | 219 | $prev_header = $key; |
@@ -222,7 +222,9 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | foreach($headers as $key => $values) { |
| 225 | - if (isset($imap_headers[$key])) continue; |
|
| 225 | + if (isset($imap_headers[$key])) { |
|
| 226 | + continue; |
|
| 227 | + } |
|
| 226 | 228 | $value = null; |
| 227 | 229 | switch($key){ |
| 228 | 230 | case 'from': |
@@ -359,9 +361,9 @@ discard block |
||
| 359 | 361 | return EncodingAliases::get($parameter->value, $this->fallback_encoding); |
| 360 | 362 | } |
| 361 | 363 | } |
| 362 | - }elseif (property_exists($structure, 'charset')) { |
|
| 364 | + } elseif (property_exists($structure, 'charset')) { |
|
| 363 | 365 | return EncodingAliases::get($structure->charset, $this->fallback_encoding); |
| 364 | - }elseif (is_string($structure) === true){ |
|
| 366 | + } elseif (is_string($structure) === true){ |
|
| 365 | 367 | return mb_detect_encoding($structure); |
| 366 | 368 | } |
| 367 | 369 | |
@@ -395,9 +397,9 @@ discard block |
||
| 395 | 397 | } |
| 396 | 398 | } |
| 397 | 399 | } |
| 398 | - }elseif($decoder === 'iconv') { |
|
| 400 | + } elseif($decoder === 'iconv') { |
|
| 399 | 401 | $value = iconv_mime_decode($value); |
| 400 | - }else{ |
|
| 402 | + } else{ |
|
| 401 | 403 | $value = mb_decode_mimeheader($value); |
| 402 | 404 | } |
| 403 | 405 | |
@@ -430,7 +432,9 @@ discard block |
||
| 430 | 432 | * Try to extract the priority from a given raw header string |
| 431 | 433 | */ |
| 432 | 434 | private function findPriority() { |
| 433 | - if(($priority = $this->get("x_priority")) === null) return; |
|
| 435 | + if(($priority = $this->get("x_priority")) === null) { |
|
| 436 | + return; |
|
| 437 | + } |
|
| 434 | 438 | switch($priority){ |
| 435 | 439 | case IMAP::MESSAGE_PRIORITY_HIGHEST; |
| 436 | 440 | $priority = IMAP::MESSAGE_PRIORITY_HIGHEST; |