This commit is contained in:
Andreas Schamberger 2011-11-01 08:28:08 +01:00
parent e0049c906d
commit da344ad03f
3 changed files with 6 additions and 7 deletions

View File

@ -50,8 +50,7 @@ class Parser
$lines = preg_split("/\r\n|\n/", $mimeMessage); $lines = preg_split("/\r\n|\n/", $mimeMessage);
foreach ($lines as $line) { foreach ($lines as $line) {
// ignore http status code and POST * // ignore http status code and POST *
if ( substr( $line, 0, 5 ) == 'HTTP/' || substr( $line, 0, 4 ) == 'POST') if (substr($line, 0, 5) == 'HTTP/' || substr($line, 0, 4) == 'POST') {
{
continue; continue;
} }
if (isset($currentHeader)) { if (isset($currentHeader)) {
@ -59,7 +58,7 @@ class Parser
$currentHeader .= $line; $currentHeader .= $line;
continue; continue;
} }
if (strpos($currentHeader,':') !== false) { if (strpos($currentHeader, ':') !== false) {
list($headerName, $headerValue) = explode(':', $currentHeader, 2); list($headerName, $headerValue) = explode(':', $currentHeader, 2);
$headerValue = iconv_mime_decode($headerValue, 0, 'utf-8'); $headerValue = iconv_mime_decode($headerValue, 0, 'utf-8');
if (strpos($headerValue, ';') !== false) { if (strpos($headerValue, ';') !== false) {
@ -129,7 +128,7 @@ class Parser
* e.g. Content-Type: multipart/related; boundary=boundary; type=text/xml; * e.g. Content-Type: multipart/related; boundary=boundary; type=text/xml;
* start="<123@abc>" * start="<123@abc>"
* *
* @see https://labs.omniti.com/alexandria/trunk/OmniTI/Mail/Parser.php * Based on: https://labs.omniti.com/alexandria/trunk/OmniTI/Mail/Parser.php
* *
* @param \BeSimple\SoapCommon\Mime\PartHeader $part Header part * @param \BeSimple\SoapCommon\Mime\PartHeader $part Header part
* @param string $headerName Header name * @param string $headerName Header name

View File

@ -103,7 +103,7 @@ abstract class PartHeader
/** /**
* Generates a header field value from the given value paramater. * Generates a header field value from the given value paramater.
* *
* @param array(string=>string)|string $value * @param array(string=>string)|string $value Header value
* @return string * @return string
*/ */
protected function generateHeaderFieldValue($value) protected function generateHeaderFieldValue($value)
@ -128,7 +128,7 @@ abstract class PartHeader
* Quote string with '"' if it contains one of the special characters: * Quote string with '"' if it contains one of the special characters:
* "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "\" / <"> / "/" / "[" / "]" / "?" / "=" * "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "\" / <"> / "/" / "[" / "]" / "?" / "="
* *
* @param string $string * @param string $string String to quote
* @return string * @return string
*/ */
private function quoteValueString($string) private function quoteValueString($string)