]> granicus.if.org Git - php/commitdiff
Loosen error check. There's no reason to forbid a single '=' occurrence
authorMoriyoshi Koizumi <moriyoshi@php.net>
Mon, 1 Dec 2003 23:49:20 +0000 (23:49 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Mon, 1 Dec 2003 23:49:20 +0000 (23:49 +0000)
in an unencoded string.
Fix white space handing. Meaningful spaces have got stripped wrongly
before this patch.

ext/iconv/iconv.c

index 23a19a3fe73e96d83fd12769e5b9ff40c92c2014..ed236ffc2eb832efc76b48579e57303829645c0b 100644 (file)
@@ -1248,22 +1248,17 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
 
                        case 1:
                                if (*p1 != '?') {
-                                       if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
-                                               err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); 
-                                               if (err != PHP_ICONV_ERR_SUCCESS) {
-                                                       goto out;
-                                               }
-                                               encoded_word = NULL;
-                                               if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) {
-                                                       scan_stat = 12;
-                                               } else {
-                                                       scan_stat = 0;
-                                               }
-                                               break;
-                                       } else {
-                                               err = PHP_ICONV_ERR_MALFORMED;
+                                       err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); 
+                                       if (err != PHP_ICONV_ERR_SUCCESS) {
                                                goto out;
                                        }
+                                       encoded_word = NULL;
+                                       if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) {
+                                               scan_stat = 12;
+                                       } else {
+                                               scan_stat = 0;
+                                       }
+                                       break;
                                }
                                csname = p1 + 1;
                                scan_stat = 2;
@@ -1596,6 +1591,8 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
                                                encoded_word = NULL;
                                                if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) {
                                                        scan_stat = 12;
+                                               } else {
+                                                       scan_stat = 0;
                                                }
                                                break;
                                }