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

index 267e2740fc966c1bc9389008f6ae112110cc988c..44178a6d1f97f5dfbb94c7a4b32f2abe9270b020 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;
                }
        }