cvs: pear /Mail_Mime mimeDecode.php
| From: | Richard Heyes | Date: | Sat, 16 Feb 2002 12:41:07 +0000 |
| Subject: | cvs: pear /Mail_Mime mimeDecode.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-2449@lists.php.net to get a copy of this message | ||
heyesr Sat Feb 16 07:41:07 2002 EDT
Modified files:
/pear/Mail_Mime mimeDecode.php
Log:
* Fixed bug which made the class miss boundary parameters that were capitalised
* Changed quoted printable decoding to recognise lowercase letters eg =3d
Index: pear/Mail_Mime/mimeDecode.php
diff -u pear/Mail_Mime/mimeDecode.php:1.20 pear/Mail_Mime/mimeDecode.php:1.21
--- pear/Mail_Mime/mimeDecode.php:1.20 Mon Dec 31 14:49:41 2001
+++ pear/Mail_Mime/mimeDecode.php Sat Feb 16 07:41:07 2002
@@ -48,7 +48,7 @@
* perhaps even message/partial.
*
* @author Richard Heyes <richard@phpguru.org>
-* @version $Revision: 1.20 $
+* @version $Revision: 1.21 $
* @package Mail
*/
@@ -377,6 +377,9 @@
if (strlen($input) > 0) {
+ // This splits on a semi-colon, if there's no preceeding backslash
+ // Can't handle if it's in double quotes however. (Of course anyone
+ // sending that needs a good slap).
$parameters = preg_split('/\s*(?<!\\\\);\s*/i', $input);
for ($i = 0; $i < count($parameters); $i++) {
@@ -386,6 +389,7 @@
$param_value = substr($param_value, 1, -1);
}
$return['other'][$param_name] = $param_value;
+ $return['other'][strtolower($param_name)] = $param_value;
}
}
} else {
@@ -444,7 +448,7 @@
case 'Q':
$text = str_replace('_', ' ', $text);
- preg_match_all('/=([A-F0-9]{2})/', $text, $matches);
+ preg_match_all('/=([a-f0-9]{2})/i', $text, $matches);
foreach($matches[1] as $value)
$text = str_replace('='.$value, chr(hexdec($value)), $text);
break;
@@ -499,7 +503,7 @@
$input = preg_replace("/=\r?\n/", '', $input);
// Replace encoded characters
- if (preg_match_all('/=[A-Z0-9]{2}/', $input, $matches)) {
+ if (preg_match_all('/=[a-f0-9]{2}/i', $input, $matches)) {
$matches = array_unique($matches[0]);
foreach ($matches as $value) {
$input = str_replace($value, chr(hexdec(substr($value,1))), $input);