Skip to content

Commit e880645

Browse files
committed
Fixed PHP7 removed functionality in pear package mimeDecode
Fixed notice level error in pear package mimeDecode
1 parent 08722b3 commit e880645

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

core_pear/Mail/mimeDecode.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,9 @@ function _parseHeaders($input)
453453
foreach ($headers as $value) {
454454
$hdr_name = substr($value, 0, $pos = strpos($value, ':'));
455455
$hdr_value = substr($value, $pos+1);
456-
if($hdr_value[0] == ' ')
456+
// ERP-modification: Small fix for notice level error
457+
// if($hdr_value[0] == ' ')
458+
if(isset($hdr_value[0]) && $hdr_value[0] == ' ')
457459
$hdr_value = substr($hdr_value, 1);
458460

459461
$return[] = array(
@@ -759,7 +761,9 @@ function _quotedPrintableDecode($input)
759761
$input = preg_replace("/=\r?\n/", '', $input);
760762

761763
// Replace encoded characters
762-
$input = preg_replace('/=([a-f0-9]{2})/ie', "chr(hexdec('\\1'))", $input);
764+
// ERP-modification: PHP7 deprecated the /e PCRE modifier.
765+
// $input = preg_replace('/=([a-f0-9]{2})/ie', "chr(hexdec('\\1'))", $input);
766+
$input = preg_replace_callback('/=([a-f0-9]{2})/i', "chr(hexdec('\\1'))", $input);
763767

764768
return $input;
765769
}

doc/CHANGELOG.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Jun 2016 - EmailReporting-0.9.2-DEV
66
- user_is_realname_valid function does not exist in MantisBT 1.3.x
77
- Changed errors formatting
88
- Added current mailbox runtime in seconds to debug mode when show memory usage is enabled
9+
- Fixed PHP7 removed functionality in pear package mimeDecode
10+
- Fixed notice level error in pear package mimeDecode
911

1012
May 2016 - EmailReporting-0.9.1
1113
- Modified error message incase no valid reporter could be found

0 commit comments

Comments
 (0)