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

Unified Diff: chrome/common/extensions/extension.cc

Issue 6879077: Make sure that extensions can launch web urls with web safe schemes only. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 8 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
« no previous file with comments | « no previous file | chrome/common/extensions/extension_manifests_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
===================================================================
--- chrome/common/extensions/extension.cc (revision 82260)
+++ chrome/common/extensions/extension.cc (working copy)
@@ -1278,8 +1278,10 @@
return false;
}
- // Ensure the launch URL is a valid absolute URL.
- if (!GURL(launch_url).is_valid()) {
+ // Ensure the launch URL is a valid absolute URL and web extent scheme.
+ GURL url(launch_url);
+ URLPattern pattern(kValidWebExtentSchemes);
+ if (!url.is_valid() || !pattern.SetScheme(url.scheme())) {
*error = errors::kInvalidLaunchWebURL;
return false;
}
« no previous file with comments | « no previous file | chrome/common/extensions/extension_manifests_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698