From 89cb450c8434f7a51f5fa88b68449d8be71b6c4e Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 3 Aug 2022 10:19:05 +0200 Subject: Detect leading spaces in config files Because those will cause PHP to output to stdout and will cause unrelated error messages. Signed-off-by: Vincent Petry --- lib/private/Config.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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 "cache = array_merge($this->cache, $CONFIG); } -- cgit v1.2.3