Commit:    d776a933eb270c7aa094c937168966fa89e2fa5c
Author:    Anatoliy Belsky <a...@php.net>         Tue, 8 May 2012 18:31:11 +0200
Parents:   3a4a25358fe3f389c434f68e59bfd70b25b93b29
Branches:  PHP-5.3 PHP-5.4 master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=d776a933eb270c7aa094c937168966fa89e2fa5c

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

Bugs:
https://bugs.php.net/61713

Changed paths:
  M  ext/standard/html.c


Diff:
diff --git a/ext/standard/html.c b/ext/standard/html.c
index c813af5..058708e 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;
                        }
                }
        }


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to