[Pkg-owncloud-commits] [owncloud] 14/95: catch any whitespaces which might get written to the output buffer while loading a theme

David Prévot taffit at moszumanska.debian.org
Wed Mar 11 15:49:44 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v8.0.1
in repository owncloud.

commit 662ebc6c8028900839cdd6d93c42faec5c6dc6c4
Author: Thomas Müller <thomas.mueller at tmit.eu>
Date:   Thu Feb 12 11:20:38 2015 +0100

    catch any whitespaces which might get written to the output buffer while loading a theme
---
 lib/private/defaults.php | 10 +++++-----
 lib/private/util.php     |  9 ++++-----
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/lib/private/defaults.php b/lib/private/defaults.php
index c16ebdb..e3ae11d 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,7 +41,11 @@ class OC_Defaults {
 		$this->defaultLogoClaim = '';
 		$this->defaultMailHeaderColor = '#1d2d44'; /* header color of mail notifications */
 
-		if (class_exists('OC_Theme')) {
+		if (file_exists(OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php')) {
+			// prevent defaults.php from printing output
+			ob_start();
+			require_once 'themes/' . OC_Util::getTheme() . '/defaults.php';
+			ob_end_clean();
 			$this->theme = new OC_Theme();
 		}
 	}
diff --git a/lib/private/util.php b/lib/private/util.php
index c08cff8..4a0a028 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list