mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
Merge pull request #33447 from nextcloud/bugfix/noid/detect-leading-spaces-in-config
Detect leading spaces in config files
This commit is contained in:
commit
5d697b54f7
1 changed files with 8 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue