mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-13 01:37:02 +02:00
gui fixes
Change-Id: I5592a96f486f64404f044b2199e74284fd2e46fd Signed-off-by: SJ <sj@acts.hu>
This commit is contained in:
@ -124,43 +124,7 @@ class Zend_Mime_Decode
|
||||
$message, &$headers, &$body, $EOL = Zend_Mime::LINEEND
|
||||
)
|
||||
{
|
||||
// check for valid header at first line
|
||||
$firstline = strtok($message, "\n");
|
||||
if (!preg_match('%^[^\s]+[^:]*:%', $firstline)) {
|
||||
$headers = array();
|
||||
// TODO: we're ignoring \r for now - is this function fast enough and is it safe to asume noone needs \r?
|
||||
$body = str_replace(
|
||||
array(
|
||||
"\r",
|
||||
"\n"
|
||||
), array(
|
||||
'',
|
||||
$EOL
|
||||
), $message
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// find an empty line between headers and body
|
||||
// default is set new line
|
||||
if (strpos($message, $EOL . $EOL)) {
|
||||
list($headers, $body) = explode($EOL . $EOL, $message, 2);
|
||||
// next is the standard new line
|
||||
} else {
|
||||
if ($EOL != "\r\n" && strpos($message, "\r\n\r\n")) {
|
||||
list($headers, $body) = explode("\r\n\r\n", $message, 2);
|
||||
// next is the other "standard" new line
|
||||
} else {
|
||||
if ($EOL != "\n" && strpos($message, "\n\n")) {
|
||||
list($headers, $body) = explode("\n\n", $message, 2);
|
||||
// at last resort find anything that looks like a new line
|
||||
} else {
|
||||
@list($headers, $body) =
|
||||
@preg_split("%([\r\n]+)\\1%U", $message, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
self::splitMessageRaw($message, $headers, $body, $EOL);
|
||||
|
||||
$headers = iconv_mime_decode_headers(
|
||||
$headers, ICONV_MIME_DECODE_CONTINUE_ON_ERROR
|
||||
@ -273,4 +237,53 @@ class Zend_Mime_Decode
|
||||
{
|
||||
return quoted_printable_decode($string);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
cut the original splitMessage() function to get the raw headers, SJ
|
||||
*/
|
||||
public static function splitMessageRaw(
|
||||
$message, &$headers, &$body, $EOL = Zend_Mime::LINEEND
|
||||
)
|
||||
{
|
||||
// check for valid header at first line
|
||||
$firstline = strtok($message, "\n");
|
||||
if (!preg_match('%^[^\s]+[^:]*:%', $firstline)) {
|
||||
$headers = array();
|
||||
// TODO: we're ignoring \r for now - is this function fast enough and is it safe to asume noone needs \r?
|
||||
$body = str_replace(
|
||||
array(
|
||||
"\r",
|
||||
"\n"
|
||||
), array(
|
||||
'',
|
||||
$EOL
|
||||
), $message
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// find an empty line between headers and body
|
||||
// default is set new line
|
||||
if (strpos($message, $EOL . $EOL)) {
|
||||
list($headers, $body) = explode($EOL . $EOL, $message, 2);
|
||||
// next is the standard new line
|
||||
} else {
|
||||
if ($EOL != "\r\n" && strpos($message, "\r\n\r\n")) {
|
||||
list($headers, $body) = explode("\r\n\r\n", $message, 2);
|
||||
// next is the other "standard" new line
|
||||
} else {
|
||||
if ($EOL != "\n" && strpos($message, "\n\n")) {
|
||||
list($headers, $body) = explode("\n\n", $message, 2);
|
||||
// at last resort find anything that looks like a new line
|
||||
} else {
|
||||
@list($headers, $body) =
|
||||
@preg_split("%([\r\n]+)\\1%U", $message, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user