From: Kirill Maximov Date: Mon, 1 Apr 2002 17:03:01 +0000 (+0000) Subject: (PHP quoted_printable_decode) Fixed CR/LF processing for Windows/OS2 X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~929 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=33ed30fce81107b85b781f02266edcf0f8c1007b;p=php (PHP quoted_printable_decode) Fixed CR/LF processing for Windows/OS2 @ Fixed CR/LF processing for Windows/OS2 in quoted_printable_decode (kir) --- diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c index e480f1ae5a..1009018bf8 100644 --- a/ext/standard/quot_print.c +++ b/ext/standard/quot_print.c @@ -44,6 +44,10 @@ static char php_hex2int(int c) { return c - 'A' + 10; } + else if ( c >= 'a' && c <= 'f' ) + { + return c - 'a' + 10; + } else { return -1; @@ -102,7 +106,7 @@ PHP_FUNCTION(quoted_printable_decode) /* End of line reached */ i += k; } - else if ( (str_in[i+k] == 10) && (str_in[i+k+1] == 13)) + else if ( (str_in[i+k] == 13) && (str_in[i+k+1] == 10)) { /* CRLF */ i += k+2; diff --git a/ext/standard/tests/general_functions/002.phpt b/ext/standard/tests/general_functions/002.phpt index d78bdb9afa..8ab1a72f07 100644 --- a/ext/standard/tests/general_functions/002.phpt +++ b/ext/standard/tests/general_functions/002.phpt @@ -3,11 +3,11 @@ quoted_printable_decode() function test --POST-- --GET-- --FILE-- - --EXPECT-- úwow-factorÁÐÕÝÅÎÎÙÅ - ÔÏÒÇÏ×ÙÅ ÐÒÏÅËÔÙ \ No newline at end of file + ÔÏÒÇÏ×ÙÅ ÐÒÏÅËÔÙ diff --git a/ext/standard/tests/general_functions/006.phpt b/ext/standard/tests/general_functions/006.phpt new file mode 100644 index 0000000000..9db1ca3280 --- /dev/null +++ b/ext/standard/tests/general_functions/006.phpt @@ -0,0 +1,13 @@ +--TEST-- +quoted_printable_decode() function test with CR/LF +--POST-- +--GET-- +--FILE-- + +--EXPECT-- +úwow-factorÁÐÕÝÅÎÎÙÅ + ÔÏÒÇÏ×ÙÅ ÐÒÏÅËÔÙ