summaryrefslogtreecommitdiffstats
path: root/apps/theming
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-29 16:12:10 +0100
committerGitHub <noreply@github.com>2018-01-29 16:12:10 +0100
commit4fcdfbf5de5496cf1fc683b6a2f4c55764de8e02 (patch)
tree2daf3982a94dec5538b5defaecf5f86280ddad6c /apps/theming
parent01482b32a171bb8529bc8baacbe764107e52e14c (diff)
parent5dbf73339542977698e1f3ae6d22624fab74fe3e (diff)
downloadnextcloud-server-4fcdfbf5de5496cf1fc683b6a2f4c55764de8e02.tar.gz
nextcloud-server-4fcdfbf5de5496cf1fc683b6a2f4c55764de8e02.zip
Merge pull request #8078 from nextcloud/theming-validate-scss
SCSS hardening
Diffstat (limited to 'apps/theming')
-rw-r--r--apps/theming/css/theming.scss18
-rw-r--r--apps/theming/lib/ThemingDefaults.php4
-rw-r--r--apps/theming/tests/ThemingDefaultsTest.php10
3 files changed, 14 insertions, 18 deletions
diff --git a/apps/theming/css/theming.scss b/apps/theming/css/theming.scss
index 63d466542e1..3cb8ee2584d 100644
--- a/apps/theming/css/theming.scss
+++ b/apps/theming/css/theming.scss
@@ -91,18 +91,20 @@
}
/* override styles for login screen in guest.css */
-#header .logo {
- background-image: url(#{$image-logo});
- @if $theming-logo-mime != '' {
+@if variable_exists('theming-logo-mime') {
+ #header .logo {
+ background-image: url(#{$image-logo});
background-size: contain;
}
}
-#body-login,
-#firstrunwizard .firstrunwizard-header,
-#theming-preview {
- background-image: url(#{$image-login-background});
- background-color: $color-primary;
+@if variable_exists('theming-background-mime') {
+ #body-login,
+ #firstrunwizard .firstrunwizard-header,
+ #theming-preview {
+ background-image: url(#{$image-login-background});
+ background-color: $color-primary;
+ }
}
input.primary,
diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php
index 9dcc981817e..94abb4e288a 100644
--- a/apps/theming/lib/ThemingDefaults.php
+++ b/apps/theming/lib/ThemingDefaults.php
@@ -242,8 +242,8 @@ class ThemingDefaults extends \OC_Defaults {
'theming-background-mime' => "'" . $this->config->getAppValue('theming', 'backgroundMime', '') . "'"
];
- $variables['image-logo'] = "'".$this->urlGenerator->getAbsoluteURL($this->getLogo())."'";
- $variables['image-login-background'] = "'".$this->urlGenerator->getAbsoluteURL($this->getBackground())."'";
+ $variables['image-logo'] = "'".$this->getLogo()."'";
+ $variables['image-login-background'] = "'".$this->getBackground()."'";
$variables['image-login-plain'] = 'false';
if ($this->config->getAppValue('theming', 'color', null) !== null) {
diff --git a/apps/theming/tests/ThemingDefaultsTest.php b/apps/theming/tests/ThemingDefaultsTest.php
index d0dc6587f74..1a4679a2993 100644
--- a/apps/theming/tests/ThemingDefaultsTest.php
+++ b/apps/theming/tests/ThemingDefaultsTest.php
@@ -517,18 +517,12 @@ class ThemingDefaultsTest extends TestCase {
['theming.Theming.getLoginBackground', [], 'custom-background'],
]);
- $this->urlGenerator->expects($this->exactly(2))
- ->method('getAbsoluteURL')
- ->willReturnCallback(function ($path) {
- return 'absolute-' . $path;
- });
-
$expected = [
'theming-cachebuster' => '\'0\'',
'theming-logo-mime' => '\'jpeg\'',
'theming-background-mime' => '\'jpeg\'',
- 'image-logo' => "'absolute-custom-logo?v=0'",
- 'image-login-background' => "'absolute-custom-background?v=0'",
+ 'image-logo' => "'custom-logo?v=0'",
+ 'image-login-background' => "'custom-background?v=0'",
'color-primary' => $this->defaults->getColorPrimary(),
'color-primary-text' => '#ffffff',
'image-login-plain' => 'false',