summaryrefslogtreecommitdiffstats
path: root/chrome/common/content_settings_pattern_parser.cc
diff options
context:
space:
mode:
authormarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-24 19:01:28 +0000
committermarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-24 19:01:28 +0000
commitb831167198ed494649ee5b83481dbf249a709408 (patch)
tree97bc2d9879514ade0ae11b3579719e3fbda46272 /chrome/common/content_settings_pattern_parser.cc
parent5e03452aba4692d3ee1a1df69ca5bc959d42b9f4 (diff)
downloadchromium_src-b831167198ed494649ee5b83481dbf249a709408.zip
chromium_src-b831167198ed494649ee5b83481dbf249a709408.tar.gz
chromium_src-b831167198ed494649ee5b83481dbf249a709408.tar.bz2
Don't allow the following content settings patterns:
- Patterns with file scheme and non empty host - File patterns that user a wildcard '*' symbol in their path - "file:///" - Patterns with an IP address and a domain wildcard. Add tests to check that "[*.]", "http://[*.]", ... are valid patterns. BUG=104414 TEST=ContentSettingsPattern* Review URL: http://codereview.chromium.org/8676020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111546 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/content_settings_pattern_parser.cc')
-rw-r--r--chrome/common/content_settings_pattern_parser.cc10
1 files changed, 2 insertions, 8 deletions
diff --git a/chrome/common/content_settings_pattern_parser.cc b/chrome/common/content_settings_pattern_parser.cc
index 437ecb1..e54834a 100644
--- a/chrome/common/content_settings_pattern_parser.cc
+++ b/chrome/common/content_settings_pattern_parser.cc
@@ -140,14 +140,8 @@ void PatternParser::Parse(const std::string& pattern_spec,
builder->WithDomainWildcard();
} else if (StartsWithASCII(host, kDomainWildcard, true)) {
host = host.substr(kDomainWildcardLength);
- // If the host still contains a wildcard symbol then it is invalid.
- if (host.find(kHostWildcard) != std::string::npos) {
- builder->Invalid();
- return;
- } else {
- builder->WithDomainWildcard();
- builder->WithHost(host);
- }
+ builder->WithDomainWildcard();
+ builder->WithHost(host);
} else {
// If the host contains a wildcard symbol then it is invalid.
if (host.find(kHostWildcard) != std::string::npos) {