Merge pull request #1230 from GPCsolutions/deprecated-5.5
Deprecated in PHP 5.5
This commit is contained in:
commit
4b2ee84ede
@ -962,7 +962,21 @@ class CMailFile
|
|||||||
$this->html_images[$i]["name"] = $img;
|
$this->html_images[$i]["name"] = $img;
|
||||||
|
|
||||||
// Content type
|
// Content type
|
||||||
$ext = preg_replace('/^.*\.(\w{3,4})$/e', 'strtolower("$1")', $img);
|
/*
|
||||||
|
* preg_replace /e modifier is deprecated in PHP 5.5
|
||||||
|
* but anonymous functions for use in preg_replace_callback are only available from 5.3.0
|
||||||
|
*/
|
||||||
|
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
|
||||||
|
$ext = preg_replace_callback(
|
||||||
|
'/^.*\.(\w{3,4})$/',
|
||||||
|
function ($m) {
|
||||||
|
return strtolower($m[1]);
|
||||||
|
},
|
||||||
|
$img
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$ext = preg_replace('/^.*\.(\w{3,4})$/e', 'strtolower("$1")', $img);
|
||||||
|
}
|
||||||
$this->html_images[$i]["content_type"] = $this->image_types[$ext];
|
$this->html_images[$i]["content_type"] = $this->image_types[$ext];
|
||||||
|
|
||||||
// cid
|
// cid
|
||||||
@ -1076,4 +1090,4 @@ class CMailFile
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -515,9 +515,23 @@ function quotedPrintEncode($str,$forcal=0)
|
|||||||
function quotedPrintDecode($str)
|
function quotedPrintDecode($str)
|
||||||
{
|
{
|
||||||
$out = preg_replace('/=\r?\n/', '', $str);
|
$out = preg_replace('/=\r?\n/', '', $str);
|
||||||
$out = preg_replace('/=([A-F0-9]{2})/e', chr(hexdec('\\1')), $out);
|
/*
|
||||||
|
* preg_replace /e modifier is deprecated in PHP 5.5
|
||||||
|
* but anonymous functions for use in preg_replace_callback are only available from 5.3.0
|
||||||
|
*/
|
||||||
|
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
|
||||||
|
$out = preg_replace_callback(
|
||||||
|
'/=([A-F0-9]{2})/',
|
||||||
|
function ($m) {
|
||||||
|
return chr(hexdec($m[1]));
|
||||||
|
},
|
||||||
|
$out
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$out = preg_replace('/=([A-F0-9]{2})/e', chr(hexdec('\\1')), $out);
|
||||||
|
}
|
||||||
|
|
||||||
return trim($out);
|
return trim($out);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -677,10 +677,24 @@ class Mail_mime
|
|||||||
foreach ($input as $hdr_name => $hdr_value) {
|
foreach ($input as $hdr_name => $hdr_value) {
|
||||||
preg_match_all('/(\w*[\x80-\xFF]+\w*)/', $hdr_value, $matches);
|
preg_match_all('/(\w*[\x80-\xFF]+\w*)/', $hdr_value, $matches);
|
||||||
foreach ($matches[1] as $value) {
|
foreach ($matches[1] as $value) {
|
||||||
$replacement = preg_replace('/([\x80-\xFF])/e',
|
/*
|
||||||
'"=" .
|
* preg_replace /e modifier is deprecated in PHP 5.5
|
||||||
strtoupper(dechex(ord("\1")))',
|
* but anonymous functions for use in preg_replace_callback are only available from 5.3.0
|
||||||
$value);
|
*/
|
||||||
|
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
|
||||||
|
$replacement = preg_replace_callback(
|
||||||
|
'/([\x80-\xFF])/',
|
||||||
|
function ($m) {
|
||||||
|
return "=" . strtoupper(dechex(ord($m[1])));
|
||||||
|
},
|
||||||
|
$value
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$replacement = preg_replace('/([\x80-\xFF])/e',
|
||||||
|
'"=" .
|
||||||
|
strtoupper(dechex(ord("\1")))',
|
||||||
|
$value);
|
||||||
|
}
|
||||||
$hdr_value = str_replace($value, '=?' .
|
$hdr_value = str_replace($value, '=?' .
|
||||||
$this->_build_params['head_charset'] .
|
$this->_build_params['head_charset'] .
|
||||||
'?Q?' . $replacement . '?=',
|
'?Q?' . $replacement . '?=',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user