diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-03 23:32:57 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-03 23:32:57 +0000 |
commit | c5a7248b45656b1ca63f9ce35b60ca337f83d3d1 (patch) | |
tree | 0f6f50e96e99046d820d9b49ccea1294244b7c2a /webkit/glue/webkit_glue.cc | |
parent | df2c7403503b45467d3d76ddc2f42296fa53ac50 (diff) | |
download | chromium_src-c5a7248b45656b1ca63f9ce35b60ca337f83d3d1.zip chromium_src-c5a7248b45656b1ca63f9ce35b60ca337f83d3d1.tar.gz chromium_src-c5a7248b45656b1ca63f9ce35b60ca337f83d3d1.tar.bz2 |
Fixes to the string MatchPattern functions:
1) Make it explicit that it only supports ASCII (since it iterates
character by character).
2) Limit the recursion to 16 levels. We could allow more, but in the
case of a ?, it has exponential complexity, so I figured 16 was a good
stopping point. It seems rare that someone would have more than 16
'?' and '*'s.
BUG=28645
Review URL: http://codereview.chromium.org/460047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33748 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webkit_glue.cc')
-rw-r--r-- | webkit/glue/webkit_glue.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc index c822040..0b3c39b 100644 --- a/webkit/glue/webkit_glue.cc +++ b/webkit/glue/webkit_glue.cc @@ -489,7 +489,7 @@ const std::string& GetUserAgent(const GURL& url) { g_user_agent->user_agent_requested = true; if (!g_user_agent->user_agent_is_overridden) { // Workarounds for sites that use misguided UA sniffing. - if (MatchPattern(url.host(), "*.pointroll.com")) { + if (MatchPatternASCII(url.host(), "*.pointroll.com")) { // For cnn.com, which uses pointroll.com to serve their front door promo, // we must spoof Chrome 1.0 in order to avoid a blank page. // http://crbug.com/25934 @@ -500,7 +500,7 @@ const std::string& GetUserAgent(const GURL& url) { return g_user_agent->mimic_chrome1_user_agent; } #if defined(OS_LINUX) - else if (MatchPattern(url.host(), "*.mail.yahoo.com")) { + else if (MatchPatternASCII(url.host(), "*.mail.yahoo.com")) { // mail.yahoo.com is ok with Windows Chrome but not Linux Chrome. // http://bugs.chromium.org/11136 // TODO(evanm): remove this if Yahoo fixes their sniffing. |