]> granicus.if.org Git - php/commitdiff
MFH: don't try to use "auto", "none" and "pass" charsets returned from mbstring
authorAntony Dovgal <tony2001@php.net>
Tue, 15 Aug 2006 15:09:38 +0000 (15:09 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 15 Aug 2006 15:09:38 +0000 (15:09 +0000)
ext/standard/html.c

index b1d05fd893cff864beffef76e9164aa71c236eb8..02b26081124d181633b53fa019967c112adad6a9 100644 (file)
@@ -756,6 +756,15 @@ static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC)
                        charset_hint = Z_STRVAL_P(uf_result);
                        len = Z_STRLEN_P(uf_result);
                        
+                       if (len == 4) { /* sizeof(none|auto|pass)-1 */
+                               if (!memcmp("pass", charset_hint, sizeof("pass") - 1) || 
+                                   !memcmp("auto", charset_hint, sizeof("auto") - 1) || 
+                                   !memcmp("none", charset_hint, sizeof("none") - 1)) {
+                                       
+                                       charset_hint = NULL;
+                                       len = 0;
+                               }
+                       }
                        goto det_charset;
                }
        }