From cfa7891b0651ed193fbaf072f99bceaf664cbe03 Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 6 Apr 2018 01:00:12 +0200 Subject: [PATCH] Catch warnings if config file rewrite fails --- application/controllers/Config.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/application/controllers/Config.php b/application/controllers/Config.php index 8a725265b..56dc59fea 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -930,17 +930,16 @@ class Config extends Secure_Controller // Chmod the file @chmod($config_path, 0777); - // Write the new config.php file - $handle = fopen($config_path, 'w+'); - // Verify file permissions if(is_writable($config_path)) { + // Write the new config.php file + $handle = @fopen($config_path, 'w+'); // Write the file $result = (fwrite($handle, $config) === FALSE) ? FALSE : TRUE; - } - fclose($handle); + fclose($handle); + } // Chmod the file @chmod($config_path, 0444);