summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-08-15 15:09:38 +0000
committerAntony Dovgal <tony2001@php.net>2006-08-15 15:09:38 +0000
commitf3c1722b0cd160f068df640957a42f5bc7ff366a (patch)
tree1ff63c4af42327d3dd42086f51235cff42a0393e
parent126b6ecd85eeaf2844cb45a394d78f0955bb5f9c (diff)
downloadphp-git-f3c1722b0cd160f068df640957a42f5bc7ff366a.tar.gz
MFH: don't try to use "auto", "none" and "pass" charsets returned from mbstring
-rw-r--r--ext/standard/html.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/standard/html.c b/ext/standard/html.c
index b1d05fd893..02b2608112 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -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;
}
}