Overworked mailbox
This commit is contained in:
@@ -508,4 +508,29 @@ class Renderer {
|
||||
return htmlspecialchars($name . ' (' . $row['description'] . ')');
|
||||
}
|
||||
|
||||
function decodeSubject($subject) {
|
||||
return $subject;
|
||||
// Match the encoding and encoded string using a regular expression
|
||||
preg_match_all('/=\?([^?]+)\?([QB])\?([^?]+)\?=/i', $subject, $matches, PREG_SET_ORDER);
|
||||
|
||||
$decoded = '';
|
||||
foreach ($matches as $match) {
|
||||
$encoding = $match[1];
|
||||
$type = $match[2];
|
||||
$encoded_string = $match[3];
|
||||
if ($type == 'Q') {
|
||||
$decoded_part = quoted_printable_decode($encoded_string);
|
||||
} elseif ($type == 'B') {
|
||||
$decoded_part = base64_decode($encoded_string);
|
||||
}
|
||||
var_dump($match);
|
||||
if (strtolower($encoding) != 'utf-8') {
|
||||
$decoded_part = iconv($encoding, 'UTF-8', $decoded_part);
|
||||
}
|
||||
$decoded .= str_replace('_', ' ', $decoded_part);
|
||||
}
|
||||
|
||||
return $decoded;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user