andrei Thu Nov 30 18:32:59 2006 UTC
Modified files:
/php-src/ext/standard quot_print.c
Log:
Make quoted_printable_decode() take only ASCII strings.
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/quot_print.c?r1=1.31&r2=1.32&diff_format=u
Index: php-src/ext/standard/quot_print.c
diff -u php-src/ext/standard/quot_print.c:1.31
php-src/ext/standard/quot_print.c:1.32
--- php-src/ext/standard/quot_print.c:1.31 Sun Jan 1 13:09:55 2006
+++ php-src/ext/standard/quot_print.c Thu Nov 30 18:32:59 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: quot_print.c,v 1.31 2006/01/01 13:09:55 sniper Exp $ */
+/* $Id: quot_print.c,v 1.32 2006/11/30 18:32:59 andrei Exp $ */
#include <stdlib.h>
@@ -147,26 +147,24 @@
* Decoding Quoted-printable string.
*
*/
-/* {{{ proto string quoted_printable_decode(string str)
+/* {{{ proto binary quoted_printable_decode(string str) U
Convert a quoted-printable string to an 8 bit string */
PHP_FUNCTION(quoted_printable_decode)
{
- zval **arg1;
char *str_in, *str_out;
+ int str_in_len;
int i = 0, j = 0, k;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) ==
FAILURE) {
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s&", &str_in,
&str_in_len, UG(ascii_conv)) == FAILURE) {
+ return;
}
- convert_to_string_ex(arg1);
- if (Z_STRLEN_PP(arg1) == 0) {
+ if (str_in_len == 0) {
/* shortcut */
RETURN_EMPTY_STRING();
}
- str_in = Z_STRVAL_PP(arg1);
- str_out = emalloc(Z_STRLEN_PP(arg1) + 1);
+ str_out = emalloc(str_in_len + 1);
while (str_in[i]) {
switch (str_in[i]) {
case '=':
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php