From: Kirill Maximov Date: Mon, 1 Apr 2002 19:27:16 +0000 (+0000) Subject: (PHP quoted_printable_decode) Fixed CR/LF processing for Windows/OS2 X-Git-Tag: php-4.2.0RC2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=496133babdfe30e32cb9295c19dac7ea7df8ec82;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..bfb78df555 100644 --- a/ext/standard/quot_print.c +++ b/ext/standard/quot_print.c @@ -41,8 +41,12 @@ static char php_hex2int(int c) return c - '0'; } else if ( c >= 'A' && c <= 'F' ) + { + return c - 'A' + 10; + } + else if ( c >= 'a' && c <= 'f' ) { - return c - 'A' + 10; + return c - 'a' + 10; } else { @@ -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; @@ -126,7 +130,7 @@ PHP_FUNCTION(quoted_printable_decode) RETVAL_STRINGL(str_out, j, 0); } -/* }}} */ +/* }}} */i /* * Local variables: diff --git a/ext/standard/tests/general_functions/002.phpt b/ext/standard/tests/general_functions/002.phpt index d78bdb9afa..918abf87e1 100644 --- a/ext/standard/tests/general_functions/002.phpt +++ b/ext/standard/tests/general_functions/002.phpt @@ -4,10 +4,10 @@ quoted_printable_decode() function test --GET-- --FILE-- --EXPECT-- úwow-factorÁÐÕÝÅÎÎÙÅ - ÔÏÒÇÏ×ÙÅ ÐÒÏÅËÔÙ \ No newline at end of file + ÔÏÒÇÏ×ÙÅ ÐÒÏÅËÔÙ