From 191a6c65d9caecea5db540c898468e631e7b2444 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 21 Jun 2016 10:36:37 +0200 Subject: [PATCH] Show error message if config file is not readable * when the config file is not writable there is a error message shown * same happens now if the config file is not readable * fixes #180 --- lib/private/Config.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/private/Config.php b/lib/private/Config.php index 3cff3ca960..4b7497decd 100644 --- a/lib/private/Config.php +++ b/lib/private/Config.php @@ -184,10 +184,10 @@ class Config { // Include file and merge config foreach ($configFiles as $file) { - $filePointer = file_exists($file) ? fopen($file, 'r') : false; + $fileExistsAndIsReadable = file_exists($file) && is_readable($file); + $filePointer = $fileExistsAndIsReadable ? fopen($file, 'r') : false; if($file === $this->configFilePath && - $filePointer === false && - @!file_exists($this->configFilePath)) { + $filePointer === false) { // Opening the main config might not be possible, e.g. if the wrong // permissions are set (likely on a new installation) continue;