summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoliy Belsky <ab@php.net>2012-05-08 18:31:11 +0200
committerAnatoliy Belsky <ab@php.net>2012-05-08 18:31:11 +0200
commitd776a933eb270c7aa094c937168966fa89e2fa5c (patch)
tree26e9c34c255a227278047332639fa1d5965ab962
parent3a4a25358fe3f389c434f68e59bfd70b25b93b29 (diff)
downloadphp-git-d776a933eb270c7aa094c937168966fa89e2fa5c.tar.gz
Fix bug 61713 check also that mbstring's found any internal_encoding
-rw-r--r--ext/standard/html.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/ext/standard/html.c b/ext/standard/html.c
index c813af523c..058708e28b 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -785,18 +785,20 @@ 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;
+ if (charset_hint != NULL && len != 0) {
+ 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;
+ }
+ } else {
+ /* Jump to det_charset only if mbstring isn't one of above eq pass, auto, none.
+ Otherwise try default_charset next */
+ goto det_charset;
}
- } else {
- /* Jump to det_charset only if mbstring isn't one of above eq pass, auto, none.
- Otherwise try default_charset next */
- goto det_charset;
}
}
}