#915 [Opn->Fbk]: Cannot decode MIME when set specific PHP Enviormental value.

From: Date: Fri, 27 Feb 2004 08:21:02 +0000
Subject: #915 [Opn->Fbk]: Cannot decode MIME when set specific PHP Enviormental value.
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-25901@lists.php.net to get a copy of this message
ID: 915 Updated by: neufeind@php.net Reported By: vishnu76 at dreamwiz dot com -Status: Open +Status: Feedback Bug Type: Bug System Operating System: RedHat 7.0 PHP Version: 4.3.4 New Comment: Where from do you get your input mime-data? Is it data sent to your script by a POST-form or something? The name "gpc" explains that normally only data coming from GET, POST or COOKIE should be affected ... Previous Comments: ------------------------------------------------------------------------ [2004-02-26 23:33:18] vishnu76 at dreamwiz dot com 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 this bug report at http://pear.php.net/bugs/bug.php?id=915&edit=1

« previous php.pear.dev (#25901) next »