summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-02-12 17:23:28 +0100
committerLukas Reschke <lukas@owncloud.com>2015-02-12 17:23:28 +0100
commit8e8acad550e45dfd7b17efca2fcb41582cd09e36 (patch)
tree8cfa27f24139f2df8e870050a1dc03df5748debc /lib
parent738fcdafbeca595d72f9beea904bbb4228ccd4b1 (diff)
parentfc7f279d90d26c5bac92d32919d2fb75e614c0a8 (diff)
downloadnextcloud-server-8e8acad550e45dfd7b17efca2fcb41582cd09e36.tar.gz
nextcloud-server-8e8acad550e45dfd7b17efca2fcb41582cd09e36.zip
Merge pull request #14145 from owncloud/no-whitespace-from-themes-master
catch any whitespaces which might get written to the output buffer while...
Diffstat (limited to 'lib')
-rw-r--r--lib/private/defaults.php15
-rw-r--r--lib/private/util.php9
2 files changed, 13 insertions, 11 deletions
diff --git a/lib/private/defaults.php b/lib/private/defaults.php
index c16ebdbe24c..dfcd97aedd6 100644
--- a/lib/private/defaults.php
+++ b/lib/private/defaults.php
@@ -1,9 +1,5 @@
<?php
-if (file_exists(OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php')) {
- require_once 'themes/' . OC_Util::getTheme() . '/defaults.php';
-}
-
/**
* Default strings and values which differ between the enterprise and the
* community edition. Use the get methods to always get the right strings.
@@ -45,8 +41,15 @@ class OC_Defaults {
$this->defaultLogoClaim = '';
$this->defaultMailHeaderColor = '#1d2d44'; /* header color of mail notifications */
- if (class_exists('OC_Theme')) {
- $this->theme = new OC_Theme();
+ $themePath = OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php';
+ if (file_exists($themePath)) {
+ // prevent defaults.php from printing output
+ ob_start();
+ require_once $themePath;
+ ob_end_clean();
+ if (class_exists('OC_Theme')) {
+ $this->theme = new OC_Theme();
+ }
}
}
diff --git a/lib/private/util.php b/lib/private/util.php
index d6c76e0960c..2be7e8eb293 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -504,11 +504,6 @@ class OC_Util {
$webServerRestart = true;
}
- //common hint for all file permissions error messages
- $permissionsHint = $l->t('Permissions can usually be fixed by '
- . '%sgiving the webserver write access to the root directory%s.',
- array('<a href="' . \OC_Helper::linkToDocs('admin-dir_permissions') . '" target="_blank">', '</a>'));
-
// Check if config folder is writable.
if (!is_writable(OC::$configDir) or !is_readable(OC::$configDir)) {
$errors[] = array(
@@ -549,6 +544,10 @@ class OC_Util {
);
}
} else if (!is_writable($CONFIG_DATADIRECTORY) or !is_readable($CONFIG_DATADIRECTORY)) {
+ //common hint for all file permissions error messages
+ $permissionsHint = $l->t('Permissions can usually be fixed by '
+ . '%sgiving the webserver write access to the root directory%s.',
+ array('<a href="' . \OC_Helper::linkToDocs('admin-dir_permissions') . '" target="_blank">', '</a>'));
$errors[] = array(
'error' => 'Data directory (' . $CONFIG_DATADIRECTORY . ') not writable by ownCloud',
'hint' => $permissionsHint