diff options
author | Kirill Maximov <kir@php.net> | 2002-04-01 17:03:01 +0000 |
---|---|---|
committer | Kirill Maximov <kir@php.net> | 2002-04-01 17:03:01 +0000 |
commit | 33ed30fce81107b85b781f02266edcf0f8c1007b (patch) | |
tree | ecb4c442623a7552f66272af4e125c83aa69446a | |
parent | def4a8485d4674cf2bb54df298c67f56ae5d1cd0 (diff) | |
download | php-git-33ed30fce81107b85b781f02266edcf0f8c1007b.tar.gz |
(PHP quoted_printable_decode) Fixed CR/LF processing for Windows/OS2
@ Fixed CR/LF processing for Windows/OS2 in quoted_printable_decode (kir)
-rw-r--r-- | ext/standard/quot_print.c | 6 | ||||
-rw-r--r-- | ext/standard/tests/general_functions/002.phpt | 6 | ||||
-rw-r--r-- | ext/standard/tests/general_functions/006.phpt | 13 |
3 files changed, 21 insertions, 4 deletions
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-- -<?php echo quoted_printable_decode("=FAwow-factor=C1=D0=D5=DD=C5=CE=CE=D9=C5=0A= -=20=D4=CF=D2=C7=CF=D7=D9=C5= +<?php echo quoted_printable_decode("=FAwow-factor=C1=d0=D5=DD=C5=CE=CE=D9=C5=0A= +=20=D4=cf=D2=C7=CF=D7=D9=C5= =20= =D0= =D2=CF=C5=CB=D4=D9"); ?> --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-- +<?php echo quoted_printable_decode("=FAwow-factor=C1=D0=D5=DD=C5=CE=CE=D9=C5=0A= +=20=D4=CF=D2=C7=CF=D7=D9=C5= +=20= +=D0= +=D2=CF=C5=CB=D4=D9"); ?> +--EXPECT-- +úwow-factorÁÐÕÝÅÎÎÙÅ + ÔÏÒÇÏ×ÙÅ ÐÒÏÅËÔÙ |