Skip to content

Commit

Permalink
Merge pull request #14145 from owncloud/no-whitespace-from-themes-master
Browse files Browse the repository at this point in the history
catch any whitespaces which might get written to the output buffer while...
  • Loading branch information
LukasReschke committed Feb 12, 2015
2 parents 738fcda + fc7f279 commit 8e8acad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
15 changes: 9 additions & 6 deletions lib/private/defaults.php
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -45,8 +41,15 @@ function __construct() {
$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();
}
}
}

Expand Down
9 changes: 4 additions & 5 deletions lib/private/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,6 @@ public static function checkServer(\OCP\IConfig $config) {
$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(
Expand Down Expand Up @@ -549,6 +544,10 @@ public static function checkServer(\OCP\IConfig $config) {
);
}
} 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
Expand Down

0 comments on commit 8e8acad

Please sign in to comment.