Commit c19a4f44 authored by YANO Takashi's avatar YANO Takashi

ZP-1202 Part of subject or from may be in junk string. Released under the...

ZP-1202 Part of subject or from may be in junk string. Released under the Affero GNU General Public License (AGPL) version 3.
parent f1031f63
...@@ -1233,7 +1233,7 @@ class Utils { ...@@ -1233,7 +1233,7 @@ class Utils {
$input = preg_replace("/\r\n(\t| )+/", ' ', $input); $input = preg_replace("/\r\n(\t| )+/", ' ', $input);
$headersonly = explode("\r\n", trim($input)); $headersonly = explode("\r\n", trim($input));
unset($input); unset($input);
$headers = array(); $headers = array("subject" => NULL, "from" => NULL);
foreach ( $headersonly as $value ) { foreach ( $headersonly as $value ) {
if ( !preg_match("/^(.+):[ \t]*(.+)$/", $value, $match) ) { if ( !preg_match("/^(.+):[ \t]*(.+)$/", $value, $match) ) {
continue; continue;
...@@ -1266,9 +1266,16 @@ class Utils { ...@@ -1266,9 +1266,16 @@ class Utils {
* decoded * decoded
* *
* @access public * @access public
* @param $mail, $message * @param &$mail, $message
*
* &$mail is reference of the caller's, not copy. So the
* call to Utils::CheckAndFixEncodingInHeaders() will not
* require memory for $mail.
* $message is a instance of a class. So the call to
* Utils::CheckAndFixEncodingInHeaders() will not
* require memory for $message
*/ */
public static function CheckAndFixEncodingInHeaders($mail, $message) { public static function CheckAndFixEncodingInHeaders(&$mail, $message) {
$rawheaders = Utils::GetRawMailHeaders($mail); $rawheaders = Utils::GetRawMailHeaders($mail);
if ( !$rawheaders ) { if ( !$rawheaders ) {
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment