Skip to content

Commit

Permalink
fix: fixes 'Fatal Error on Empty Redis Port Setting' bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Pathan-Amaankhan committed Apr 12, 2024
1 parent 5d779c4 commit b4f8715
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion admin/partials/nginx-helper-general-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,21 @@

$site_options = get_site_option( 'rt_wp_nginx_helper_options', array() );

// Uncheck checkbox fields whose default value is `1` but user has unchecked.
foreach ( $nginx_helper_admin->nginx_helper_default_settings() as $default_setting_field => $default_setting_value ) {

// Uncheck checkbox fields whose default value is `1` but user has unchecked.
if ( 1 === $default_setting_value && isset( $site_options[ $default_setting_field ] ) && empty( $all_inputs[ $default_setting_field ] ) ) {

$nginx_settings[ $default_setting_field ] = 0;

}

// Populate the setting field with default value when it is empty.
if ( '' === $nginx_settings[ $default_setting_field ] ) {

$nginx_settings[ $default_setting_field ] = $default_setting_value;

}
}

if ( ( ! is_numeric( $nginx_settings['log_filesize'] ) ) || ( empty( $nginx_settings['log_filesize'] ) ) ) {
Expand Down

0 comments on commit b4f8715

Please sign in to comment.