Skip to content

Commit

Permalink
Trigger warning when config files are not readable (#9550)
Browse files Browse the repository at this point in the history
* trigger error when config files are not readable

fixes issue #9549
  • Loading branch information
JohnRDOrazio authored Jul 27, 2024
1 parent 657f397 commit cd92b26
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions program/lib/Roundcube/rcube_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,20 +299,24 @@ public function load_from_file($file)
$success = false;

foreach ($this->resolve_paths($file) as $fpath) {
if ($fpath && is_file($fpath) && is_readable($fpath)) {
// use output buffering, we don't need any output here
ob_start();
require $fpath;
ob_end_clean();

if (isset($config) && is_array($config)) {
$this->merge($config);
$success = true;
}
// deprecated name of config variable
if (isset($rcmail_config) && is_array($rcmail_config)) {
$this->merge($rcmail_config);
$success = true;
if ($fpath && is_file($fpath)) {
if (is_readable($fpath) === false) {
trigger_error($fpath . ' is not readable', \E_USER_WARNING);
} else {
// use output buffering, we don't need any output here
ob_start();
require $fpath;
ob_end_clean();

if (isset($config) && is_array($config)) {
$this->merge($config);
$success = true;
}
// deprecated name of config variable
if (isset($rcmail_config) && is_array($rcmail_config)) {
$this->merge($rcmail_config);
$success = true;
}
}
}
}
Expand Down

0 comments on commit cd92b26

Please sign in to comment.