}
$result = self::parseRawHeader($stream, $raw_headers, $boundary, $result);
+
$raw_headers = '';
}
continue;
}
list($name, $value) = explode(':', $header, 2);
+
$headers[strtolower($name)] = ltrim($value, ' ');
}
if (isset($headers['content-type'])) {
$tmp = explode(';', $headers['content-type']);
+
$contentType = $tmp[0];
} else {
$contentType = 'unknown';
}
if ($encoding !== '' && strtoupper($encoding) !== 'UTF-8' && strtoupper($encoding) !== 'UTF8') {
- $tmp = mb_convert_encoding($fullValue, 'UTF-8', $encoding);
- if ($tmp !== false) {
- $fullValue = $tmp;
- }
+ $tmp = mb_convert_encoding($fullValue, 'UTF-8', $encoding);
+ if ($tmp !== false) {
+ $fullValue = $tmp;
+ }
}
}