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

Unified Diff: chrome/common/content_settings_pattern.cc

Issue 13251012: Fix b180514: Some exception entries cannot be deleted from a setting panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forbid multiple ending dots. Created 7 years, 9 months 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
Index: chrome/common/content_settings_pattern.cc
diff --git a/chrome/common/content_settings_pattern.cc b/chrome/common/content_settings_pattern.cc
index 98ac6d637e2e52cae9ba9d582122e3d724e53dd6..93113ad6797c58f7d5ebc3b0e402671058c2cbdb 100644
--- a/chrome/common/content_settings_pattern.cc
+++ b/chrome/common/content_settings_pattern.cc
@@ -174,6 +174,13 @@ bool ContentSettingsPattern::Builder::Canonicalize(PatternParts* parts) {
// Canonicalize the host part.
const std::string host(parts->host);
+ if (host.size() >= 2 &&
+ host[host.size() - 1] == '.' &&
markusheintz_ 2013/04/02 19:16:46 What about a..a? Please move this logic to the ch
yhirano 2013/04/02 19:54:54 Done.
+ host[host.size() - 2] == '.') {
+ // There are multiple ending dots.
+ return false;
+ }
+
url_canon::CanonHostInfo host_info;
std::string canonicalized_host(net::CanonicalizeHost(host, &host_info));
if (host_info.IsIPAddress() && parts->has_domain_wildcard)
« no previous file with comments | « no previous file | chrome/common/content_settings_pattern_unittest.cc » ('j') | chrome/common/content_settings_pattern_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698