From 328f2208fcbd679bc62999e2fa647ea9b00eed0a Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Thu, 24 Dec 2020 16:10:21 +0100 Subject: [PATCH] Prevent system warning when creating config_inc.php Due to the same root cause as issue #27796, the `@` operator does not suppress the error. Instead of suppressing the error, check whether the parent directory is writable before calling fopen(). --- admin/install.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/admin/install.php b/admin/install.php index 1905e47b0f..b23a53520a 100644 --- a/admin/install.php +++ b/admin/install.php @@ -1249,7 +1249,10 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes $t_write_failed = true; if( !$t_config_exists ) { - if( $t_fd = @fopen( $t_config_filename, 'w' ) ) { + # Try to create the config file + if( is_writable( $g_config_path ) + && $t_fd = fopen( $t_config_filename, 'w' ) + ) { fwrite( $t_fd, $t_config ); fclose( $t_fd ); }