Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1781)

Unified Diff: chrome/common/content_settings_pattern_parser.cc

Issue 8676020: Detect invalid content settings pattern that were not detected yet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/content_settings_pattern.cc ('k') | chrome/common/content_settings_pattern_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/content_settings_pattern_parser.cc
diff --git a/chrome/common/content_settings_pattern_parser.cc b/chrome/common/content_settings_pattern_parser.cc
index 437ecb1f1a9109962a18379bf22082d3389b60a8..e54834a3cbba6a6120964d29a5d8c51ba8bfb39d 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) {
« no previous file with comments | « chrome/common/content_settings_pattern.cc ('k') | chrome/common/content_settings_pattern_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698