diff options
author | Jasper Weyne <jasperweyne@gmail.com> | 2022-08-11 08:54:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-11 08:54:08 +0200 |
commit | 44f6c931e7c9c74ea4f448d3cdfbaa89f3b7c379 (patch) | |
tree | 710a8c1bd1c20c685991de146aa9ef149ec1de7a /lib/private/Config.php | |
parent | 0633a1d9f5a7ef06d577ae6556d09db9e94f5684 (diff) | |
parent | a61331f4560468e6d433cf32e008b157b06e7ea9 (diff) | |
download | nextcloud-server-44f6c931e7c9c74ea4f448d3cdfbaa89f3b7c379.tar.gz nextcloud-server-44f6c931e7c9c74ea4f448d3cdfbaa89f3b7c379.zip |
Merge branch 'master' into patch-2
Diffstat (limited to 'lib/private/Config.php')
-rw-r--r-- | lib/private/Config.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/Config.php b/lib/private/Config.php index b044d0731a3..37708357339 100644 --- a/lib/private/Config.php +++ b/lib/private/Config.php @@ -231,6 +231,14 @@ class Config { unset($CONFIG); include $file; + if (!defined('PHPUNIT_RUN') && headers_sent()) { + // syntax issues in the config file like leading spaces causing PHP to send output + $errorMessage = sprintf('Config file has leading content, please remove everything before "<?php" in %s', basename($file)); + if (!defined('OC_CONSOLE')) { + print(\OCP\Util::sanitizeHTML($errorMessage)); + } + throw new \Exception($errorMessage); + } if (isset($CONFIG) && is_array($CONFIG)) { $this->cache = array_merge($this->cache, $CONFIG); } |