Merge pull request #14145 from owncloud/no-whitespace-from-themes-master

catch any whitespaces which might get written to the output buffer while...
This commit is contained in:
Lukas Reschke 2015-02-12 17:23:28 +01:00
commit 8e8acad550
2 changed files with 13 additions and 11 deletions

View File

@ -1,9 +1,5 @@
<?php <?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 * Default strings and values which differ between the enterprise and the
* community edition. Use the get methods to always get the right strings. * community edition. Use the get methods to always get the right strings.
@ -45,8 +41,15 @@ class OC_Defaults {
$this->defaultLogoClaim = ''; $this->defaultLogoClaim = '';
$this->defaultMailHeaderColor = '#1d2d44'; /* header color of mail notifications */ $this->defaultMailHeaderColor = '#1d2d44'; /* header color of mail notifications */
if (class_exists('OC_Theme')) { $themePath = OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php';
$this->theme = new OC_Theme(); 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();
}
} }
} }

View File

@ -504,11 +504,6 @@ class OC_Util {
$webServerRestart = true; $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. // Check if config folder is writable.
if (!is_writable(OC::$configDir) or !is_readable(OC::$configDir)) { if (!is_writable(OC::$configDir) or !is_readable(OC::$configDir)) {
$errors[] = array( $errors[] = array(
@ -549,6 +544,10 @@ class OC_Util {
); );
} }
} else if (!is_writable($CONFIG_DATADIRECTORY) or !is_readable($CONFIG_DATADIRECTORY)) { } 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( $errors[] = array(
'error' => 'Data directory (' . $CONFIG_DATADIRECTORY . ') not writable by ownCloud', 'error' => 'Data directory (' . $CONFIG_DATADIRECTORY . ') not writable by ownCloud',
'hint' => $permissionsHint 'hint' => $permissionsHint