diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-02-12 11:20:38 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-02-12 16:42:17 +0100 |
commit | fc7f279d90d26c5bac92d32919d2fb75e614c0a8 (patch) | |
tree | 0c53d861880a3fb9c6045376e63a52a942ee965e /lib/private/defaults.php | |
parent | 0b38a48bb4f1150710209577d15d8041574aa29a (diff) | |
download | nextcloud-server-fc7f279d90d26c5bac92d32919d2fb75e614c0a8.tar.gz nextcloud-server-fc7f279d90d26c5bac92d32919d2fb75e614c0a8.zip |
catch any whitespaces which might get written to the output buffer while loading a theme
Diffstat (limited to 'lib/private/defaults.php')
-rw-r--r-- | lib/private/defaults.php | 15 |
1 files changed, 9 insertions, 6 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(); + } } } |