Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix bug 61713 check also that mbstring's found any internal_encoding

  • Loading branch information...
commit d776a933eb270c7aa094c937168966fa89e2fa5c 1 parent 3a4a253
@weltling weltling authored
Showing with 13 additions and 11 deletions.
  1. +13 −11 ext/standard/html.c
View
24 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;
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.