#915 [NEW]: Cannot decode MIME when set specific PHP Enviormental value.
| From: | vishnu76 at dreamwiz dot com | Date: | Fri, 27 Feb 2004 04:33:18 +0000 |
| Subject: | #915 [NEW]: Cannot decode MIME when set specific PHP Enviormental value. | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-25898@lists.php.net to get a copy of this message | ||
From: vishnu76 at dreamwiz dot com
Operating system: RedHat 7.0
PHP version: 4.3.4
PHP Bug Type: Bug System
Bug description: Cannot decode MIME when set specific PHP Enviormental value.
Description:
------------
Cannot decode Multipart MIME data at specific case.
Many Korean PHP Web Hosting service is setted "magic_quotes_gpc" is true.
At that time Mail_MimeDecode::decode() function cannot decode multipart
mime data.
Reproduce code:
---------------
For example, see below mime header.
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="=_mime_boundary"
--=_mime_boundary
Content-Type: text/html;
charset="euc_kr"
Content-Transfer-Encoding: base64
If PHP is setted gpc_magic_quotes is TRUE, above code will be change like
under codes.
MIME-Version: 1.0
Content-Type: multipart/related;
boundary=\"=_mime_boundary\"
--=_mime_boundary
Content-Type: text/html;
charset=\"euc_kr\"
Content-Transfer-Encoding: base64
Now, PEAR MIME Package cannot decode Above mime data.
Expected result:
----------------
PEAR Package must decode mime data.
Actual result:
--------------
I have change _parseHeaderValue function in PEAR MIME Package. See
Below..
for ($i = 0; $i < count($parameters); $i++) {
$param_name = substr($parameters[$i], 0, $pos =
strpos($parameters[$i], '='));
$param_value = substr($parameters[$i], $pos + 1);
//Debug
if(get_magic_quotes_gpc())
$param_value = stripslashes($param_value);
//Debug
if ($param_value[0] == '"') {
$param_value = substr($param_value, 1, -1);
}
$return['other'][$param_name] = $param_value;
$return['other'][strtolower($param_name)] =
$param_value;
}
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=915&edit=1
--