@@ -33,12 +33,12 @@ function getDatabaseSettings(): array
3333 'forced_test_forwarded_ip ' => esc_attr (get_option ('crowdsec_forced_test_forwarded_ip ' )),
3434 'display_errors ' => !empty (get_option ('crowdsec_display_errors ' )),
3535 // Bouncer
36- 'bouncing_level ' => esc_attr (get_option ('crowdsec_bouncing_level ' )),
36+ 'bouncing_level ' => esc_attr (get_option ('crowdsec_bouncing_level ' ))?:Constants:: BOUNCING_LEVEL_DISABLED ,
3737 'trust_ip_forward_array ' => get_option ('crowdsec_trust_ip_forward_array ' ),
3838 'fallback_remediation ' => esc_attr (get_option ('crowdsec_fallback_remediation ' )),
3939 // Cache settings
4040 'stream_mode ' => !empty (get_option ('crowdsec_stream_mode ' )),
41- 'cache_system ' => esc_attr (get_option ('crowdsec_cache_system ' )),
41+ 'cache_system ' => esc_attr (get_option ('crowdsec_cache_system ' ))?:Constants:: CACHE_SYSTEM_PHPFS ,
4242 'fs_cache_path ' => Constants::CROWDSEC_CACHE_PATH ,
4343 'redis_dsn ' => esc_attr (get_option ('crowdsec_redis_dsn ' )),
4444 'memcached_dsn ' => esc_attr (get_option ('crowdsec_memcached_dsn ' )),
@@ -53,10 +53,10 @@ function getDatabaseSettings(): array
5353 // Geolocation
5454 'geolocation ' => [
5555 'enabled ' => !empty (get_option ('crowdsec_geolocation_enabled ' )),
56- 'type ' => esc_attr (get_option ('crowdsec_geolocation_type ' )),
56+ 'type ' => esc_attr (get_option ('crowdsec_geolocation_type ' )) ?: Constants:: GEOLOCATION_TYPE_MAXMIND ,
5757 'save_result ' => !empty (get_option ('crowdsec_geolocation_save_result ' )),
5858 'maxmind ' => [
59- 'database_type ' => esc_attr (get_option ('crowdsec_geolocation_maxmind_database_type ' )),
59+ 'database_type ' => esc_attr (get_option ('crowdsec_geolocation_maxmind_database_type ' )) ?: Constants:: MAXMIND_COUNTRY ,
6060 'database_path ' => Constants::CROWDSEC_BOUNCER_GEOLOCATION_DIR . '/ ' .ltrim (esc_attr (get_option ('crowdsec_geolocation_maxmind_database_path ' )), '/ ' ),
6161 ]
6262 ]
0 commit comments