We can't just assume that the URLs that we generate are safe to use
in url() without quotes. There's already a function that automatically
uses quotes where necessary, so use that.
Change-Id: I6663e49b82592eb45b8854fcff56ac966b39f8ce
* @return string[] CSS declarations to use given URIs as background-image
*/
protected function getCssDeclarations( $primary, $fallback ) {
* @return string[] CSS declarations to use given URIs as background-image
*/
protected function getCssDeclarations( $primary, $fallback ) {
+ $primaryUrl = CSSMin::buildUrlValue( $primary );
+ $fallbackUrl = CSSMin::buildUrlValue( $fallback );
- "background-image: url($fallback);",
- "background-image: linear-gradient(transparent, transparent), url($primary);",
+ "background-image: $fallbackUrl;",
+ "background-image: linear-gradient(transparent, transparent), $primaryUrl;",
// Do not serve SVG to Opera 12, bad rendering with border-radius or background-size (T87504)
// Do not serve SVG to Opera 12, bad rendering with border-radius or background-size (T87504)
- "background-image: -o-linear-gradient(transparent, transparent), url($fallback);",
+ "background-image: -o-linear-gradient(transparent, transparent), $fallbackUrl;",