- last update
over 1 year ago Patch Failed to Apply
public static function toHeaders($input) {
$headers = [];
if (!is_array($input)) {
$decoder = new \Mail_mimeDecode($input);
$input = $decoder->decode([
'decode_headers' => TRUE,
'input' => $input,
]);
}
foreach ($input as $name => $value) {
$name = preg_replace(
[
'/([[:alpha:]])([[:alpha:]]+)/',
'/^Mime-/',
'/-Id$/',
],
[
'strtoupper("\1") . strtolower("\2")',
'MIME-',
'-ID',
],
$name
);
$headers[$name] = $value;
}
return $headers;
}
In this snippet, you can no longer do strtoupper() in the preg_replace as I believe the `e` modifier has been deprecated due to security issues?
I'm getting these headers:
[headers] => Array
(
[strtoupper("M") . strtolower("IME")-strtoupper("V") . strtolower("ersion")] => 1.0
[strtoupper("C") . strtolower("ontent")-strtoupper("T") . strtolower("ype")] => text/plain; charset=UTF-8; format=flowed; delsp=yes
[strtoupper("C") . strtolower("ontent")-strtoupper("T") . strtolower("ransfer")-strtoupper("E") . strtolower("ncoding")] => 8Bit
[X-strtoupper("M") . strtolower("ailer")] => Drupal
[strtoupper("R") . strtolower("eturn")-strtoupper("P") . strtolower("ath")] => test@example.com
[strtoupper("S") . strtolower("ender")] => test@example.com
[strtoupper("F") . strtolower("rom")] => Example Site
[strtoupper("R") . strtolower("eply")-strtoupper("t") . strtolower("o")] => test@example.com
[MIME-Version] => 1.0
[Content-Type] => text/html; charset=ISO-8859-1
[Content-Transfer-Encoding] => quoted-printable
)/
Needs review
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.