]> granicus.if.org Git - php/commitdiff
(PHP quoted_printable_decode) Fixed CR/LF processing for Windows/OS2
authorKirill Maximov <kir@php.net>
Mon, 1 Apr 2002 19:27:16 +0000 (19:27 +0000)
committerKirill Maximov <kir@php.net>
Mon, 1 Apr 2002 19:27:16 +0000 (19:27 +0000)
@ Fixed CR/LF processing for Windows/OS2 in quoted_printable_decode (kir)

ext/standard/quot_print.c
ext/standard/tests/general_functions/002.phpt

index e480f1ae5afc79fa61980d7933c2bd9e5f70be66..bfb78df555f4d18478b0c8fba7a63d4606961871 100644 (file)
@@ -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:
index d78bdb9afaaed8f09927fefaee7a608bc05589c5..918abf87e1bb26764aad37b9ba595b94f46faff4 100644 (file)
@@ -4,10 +4,10 @@ quoted_printable_decode() function test
 --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=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
+ ÔÏÒÇÏ×ÙÅ ÐÒÏÅËÔÙ