From b97d9b2ac779103239b4ec1bec9dc1399b5ad9e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Mon, 4 Mar 2024 17:47:33 +0100 Subject: [PATCH] Fix default_socket_timeout invalid values --- Controller/MapController.php | 2 +- Parser/TokenParser.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Controller/MapController.php b/Controller/MapController.php index 869d5ab..255c47b 100644 --- a/Controller/MapController.php +++ b/Controller/MapController.php @@ -54,7 +54,7 @@ class MapController extends AbstractController implements ServiceSubscriberInter 'http' => [ #'header' => ['Referer: https://www.openstreetmap.org/'], 'max_redirects' => $_ENV['RAPSYSPACK_REDIRECT'] ?? 20, - 'timeout' => $_ENV['RAPSYSPACK_TIMEOUT'] ?? (int)ini_get('default_socket_timeout') ?: 60, + 'timeout' => $_ENV['RAPSYSPACK_TIMEOUT'] ?? (($timeout = ini_get('default_socket_timeout')) !== false && $timeout !== "" ? (float)$timeout : 60), 'user_agent' => $_ENV['RAPSYSPACK_AGENT'] ?? (($agent = ini_get('user_agent')) !== false && $agent !== "" ? (string)$agent : RapsysPackBundle::getAlias().'/'.RapsysPackBundle::getVersion()) ] ] diff --git a/Parser/TokenParser.php b/Parser/TokenParser.php index 1115e0c..07267b9 100644 --- a/Parser/TokenParser.php +++ b/Parser/TokenParser.php @@ -50,7 +50,7 @@ class TokenParser extends AbstractTokenParser { 'http' => [ #'header' => ['Referer: https://www.openstreetmap.org/'], 'max_redirects' => $_ENV['RAPSYSPACK_REDIRECT'] ?? 20, - 'timeout' => $_ENV['RAPSYSPACK_TIMEOUT'] ?? (int)ini_get('default_socket_timeout') ?: 60, + 'timeout' => $_ENV['RAPSYSPACK_TIMEOUT'] ?? (($timeout = ini_get('default_socket_timeout')) !== false && $timeout !== "" ? (float)$timeout : 60), 'user_agent' => $_ENV['RAPSYSPACK_AGENT'] ?? (($agent = ini_get('user_agent')) !== false && $agent !== "" ? (string)$agent : RapsysPackBundle::getAlias().'/'.RapsysPackBundle::getVersion()) ] ] -- 2.41.1