diff options
author | Dmitry Stogov <dmitry@zend.com> | 2015-03-11 15:02:47 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2015-03-11 15:02:47 +0300 |
commit | 781d1c400c195e9e32edd23504b34069ea0e50cb (patch) | |
tree | 5361e38d5684d9278df81626e052e0fea0938660 /ext/standard/html.c | |
parent | 80274290b7107a8171806967dd098047f183b008 (diff) | |
download | php-git-781d1c400c195e9e32edd23504b34069ea0e50cb.tar.gz |
Improved table search
Diffstat (limited to 'ext/standard/html.c')
-rw-r--r-- | ext/standard/html.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/standard/html.c b/ext/standard/html.c index c8e36b8d45..cce1b73be8 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -451,8 +451,9 @@ det_charset: int found = 0; /* now walk the charset map and look for the codeset */ - for (i = 0; charset_map[i].codeset; i++) { - if (len == strlen(charset_map[i].codeset) && strncasecmp(charset_hint, charset_map[i].codeset, len) == 0) { + for (i = 0; i < sizeof(charset_map)/sizeof(charset_map[0]); i++) { + if (len == charset_map[i].codeset_len && + zend_binary_strcasecmp(charset_hint, len, charset_map[i].codeset, len) == 0) { charset = charset_map[i].charset; found = 1; break; |