@@ -62,14 +62,14 @@ public function handleRawConfigs(array $rawConfigs): array
6262 {
6363 return [
6464 // LAPI connection
65- 'api_key ' => $ this ->escape ($ rawConfigs ['crowdsec_api_key ' ] ?? '' ),
65+ 'api_key ' => $ this ->escape (( string ) $ rawConfigs ['crowdsec_api_key ' ] ?? '' ),
6666 'auth_type ' => (string )($ rawConfigs ['crowdsec_auth_type ' ] ?? Constants::AUTH_KEY ),
67- 'tls_cert_path ' => Constants::TLS_DIR . '/ ' . ltrim ($ rawConfigs ['crowdsec_tls_cert_path ' ] ?? '' , '/ ' ),
68- 'tls_key_path ' => Constants::TLS_DIR . '/ ' . ltrim ($ rawConfigs ['crowdsec_tls_key_path ' ] ?? '' , '/ ' ),
67+ 'tls_cert_path ' => Constants::TLS_DIR . '/ ' . ltrim (( string ) $ rawConfigs ['crowdsec_tls_cert_path ' ] ?? '' , '/ ' ),
68+ 'tls_key_path ' => Constants::TLS_DIR . '/ ' . ltrim (( string ) $ rawConfigs ['crowdsec_tls_key_path ' ] ?? '' , '/ ' ),
6969 'tls_verify_peer ' => (bool )($ rawConfigs ['crowdsec_tls_verify_peer ' ] ?? false ),
7070 'tls_ca_cert_path ' => Constants::TLS_DIR . '/ ' .
71- ltrim ($ rawConfigs ['crowdsec_tls_ca_cert_path ' ], '/ ' ),
72- 'api_url ' => $ this ->escape ($ rawConfigs ['crowdsec_api_url ' ] ?? '' ),
71+ ltrim (( string ) $ rawConfigs ['crowdsec_tls_ca_cert_path ' ], '/ ' ),
72+ 'api_url ' => $ this ->escape (( string ) $ rawConfigs ['crowdsec_api_url ' ] ?? '' ),
7373 'use_curl ' => (bool )($ rawConfigs ['crowdsec_use_curl ' ] ?? false ),
7474 'api_timeout ' => (int )($ rawConfigs ['crowdsec_api_timeout ' ] ?? Constants::API_TIMEOUT ),
7575 // Debug
@@ -86,10 +86,10 @@ public function handleRawConfigs(array $rawConfigs): array
8686 Constants::REMEDIATION_BYPASS ),
8787 // Cache settings
8888 'stream_mode ' => (bool )($ rawConfigs ['crowdsec_stream_mode ' ] ?? false ),
89- 'cache_system ' => $ this ->escape ($ rawConfigs ['crowdsec_cache_system ' ] ?? Constants::CACHE_SYSTEM_PHPFS ),
89+ 'cache_system ' => $ this ->escape (( string ) $ rawConfigs ['crowdsec_cache_system ' ] ?? Constants::CACHE_SYSTEM_PHPFS ),
9090 'fs_cache_path ' => Constants::CACHE_PATH ,
91- 'redis_dsn ' => $ this ->escape ($ rawConfigs ['crowdsec_redis_dsn ' ] ?? '' ),
92- 'memcached_dsn ' => $ this ->escape ($ rawConfigs ['crowdsec_memcached_dsn ' ] ?? '' ),
91+ 'redis_dsn ' => $ this ->escape (( string ) $ rawConfigs ['crowdsec_redis_dsn ' ] ?? '' ),
92+ 'memcached_dsn ' => $ this ->escape (( string ) $ rawConfigs ['crowdsec_memcached_dsn ' ] ?? '' ),
9393 'clean_ip_cache_duration ' => (int )($ rawConfigs ['crowdsec_clean_ip_cache_duration ' ] ??
9494 Constants::CACHE_EXPIRATION_FOR_CLEAN_IP ),
9595 'bad_ip_cache_duration ' => (int )($ rawConfigs ['crowdsec_bad_ip_cache_duration ' ] ??
0 commit comments