fix(security): allow empty CSS values. (#9675)

This commit is contained in:
Martin Probst
2016-06-28 11:45:02 -07:00
committed by GitHub
parent 5ee84fe0f6
commit 2d9d7f1310
2 changed files with 2 additions and 0 deletions

View File

@ -82,6 +82,7 @@ function hasBalancedQuotes(value: string) {
*/
export function sanitizeStyle(value: string): string {
value = String(value).trim(); // Make sure it's actually a string.
if (!value) return '';
// Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for
// reasoning behind this.