-
-
Save danbeam/fc99e28f48b6696ddf9d13176fee3c61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/chrome/browser/resources/settings/appearance_page/appearance_page.js b/chrome/browser/resources/settings/appearance_pes | |
index 5571b2d24992..de068c7715ae 100644 | |
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.js | |
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.js | |
@@ -262,6 +262,7 @@ Polymer({ | |
themeChanged_: function(themeId, useSystemTheme) { | |
if (themeId) { | |
assert(!useSystemTheme); | |
+ assert(isValidExtensionId(themeId)); | |
this.browserProxy_.getThemeInfo(themeId).then(function(info) { | |
this.themeSublabel_ = info.name; | |
diff --git a/ui/webui/resources/js/util.js b/ui/webui/resources/js/util.js | |
index 28a60d2ce137..22b013369dd9 100644 | |
--- a/ui/webui/resources/js/util.js | |
+++ b/ui/webui/resources/js/util.js | |
@@ -46,6 +46,14 @@ function announceAccessibleMessage(msg) { | |
} | |
/** | |
+ * @param {?} maybeId | |
+ * @return {boolean} Whether |maybeId| is a valid extension ID. | |
+ */ | |
+function isValidExtensionId(maybeId) { | |
+ return /[a-p]{32}/i.test(maybeId); | |
+} | |
+ | |
+/** | |
* Generates a CSS url string. | |
* @param {string} s The URL to generate the CSS url for. | |
* @return {string} The CSS url string. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment