diff --git a/custom/apps/boersenchecker/bootstrap.php b/custom/apps/boersenchecker/bootstrap.php index cea0bba7..e7d9b0d8 100644 --- a/custom/apps/boersenchecker/bootstrap.php +++ b/custom/apps/boersenchecker/bootstrap.php @@ -408,7 +408,7 @@ $mm->registerFunction($moduleName, 'alpha_vantage_request', static function ( $responseBody = curl_exec($ch); $curlError = curl_error($ch); $httpCode = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE); - curl_close($ch); + unset($ch); } } diff --git a/custom/apps/fx-rates/src/Domain/FxRatesService.php b/custom/apps/fx-rates/src/Domain/FxRatesService.php index ffde4358..4aaed98b 100644 --- a/custom/apps/fx-rates/src/Domain/FxRatesService.php +++ b/custom/apps/fx-rates/src/Domain/FxRatesService.php @@ -525,7 +525,7 @@ final class FxRatesService $response = curl_exec($ch); $httpStatus = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE); $curlError = curl_error($ch); - curl_close($ch); + unset($ch); if ($response === false || $curlError !== '' || $httpStatus >= 400) { $payload = is_string($response) ? json_decode($response, true) : null; diff --git a/custom/apps/mining-checker/src/Domain/FxService.php b/custom/apps/mining-checker/src/Domain/FxService.php index 877b3c1e..cc52ccfc 100644 --- a/custom/apps/mining-checker/src/Domain/FxService.php +++ b/custom/apps/mining-checker/src/Domain/FxService.php @@ -414,7 +414,7 @@ final class FxService $response = curl_exec($ch); $httpStatus = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE); $curlError = curl_error($ch); - curl_close($ch); + unset($ch); $this->debug?->add('fx.latest.response', [ 'http_status' => $httpStatus, @@ -461,7 +461,7 @@ final class FxService $httpStatus = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE); $headerSize = (int) curl_getinfo($ch, CURLINFO_HEADER_SIZE); $curlError = curl_error($ch); - curl_close($ch); + unset($ch); $rawHeaders = is_string($response) ? substr($response, 0, $headerSize) : ''; $body = is_string($response) ? substr($response, $headerSize) : ''; @@ -507,7 +507,7 @@ final class FxService $response = curl_exec($ch); $httpStatus = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE); $curlError = curl_error($ch); - curl_close($ch); + unset($ch); $this->debug?->add('fx.currencies.response', [ 'http_status' => $httpStatus, @@ -562,7 +562,7 @@ final class FxService $httpStatus = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE); $headerSize = (int) curl_getinfo($ch, CURLINFO_HEADER_SIZE); $curlError = curl_error($ch); - curl_close($ch); + unset($ch); $rawHeaders = is_string($response) ? substr($response, 0, $headerSize) : ''; $body = is_string($response) ? substr($response, $headerSize) : ''; diff --git a/custom/apps/mining-checker/src/Domain/OcrService.php b/custom/apps/mining-checker/src/Domain/OcrService.php index 9fb5c351..90be286f 100644 --- a/custom/apps/mining-checker/src/Domain/OcrService.php +++ b/custom/apps/mining-checker/src/Domain/OcrService.php @@ -182,7 +182,7 @@ final class OcrService $response = curl_exec($ch); $curlError = curl_error($ch); $httpStatus = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE); - curl_close($ch); + unset($ch); if ($response === false || $curlError !== '') { return [ diff --git a/custom/apps/pihole/api/index.php b/custom/apps/pihole/api/index.php index 75088a45..2f6f72a5 100644 --- a/custom/apps/pihole/api/index.php +++ b/custom/apps/pihole/api/index.php @@ -168,7 +168,7 @@ $httpRequest = function (string $method, string $url, array $headers, ?string $b $error = curl_error($ch); } $httpCode = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); + unset($ch); } else { $ctx = stream_context_create([ 'http' => [ diff --git a/custom/apps/pihole/partials/instances.php b/custom/apps/pihole/partials/instances.php index 12e9853f..fc57496a 100644 --- a/custom/apps/pihole/partials/instances.php +++ b/custom/apps/pihole/partials/instances.php @@ -32,7 +32,7 @@ $httpRequest = static function (string $method, string $url, array $headers, ?st $requestError = curl_error($ch); } $httpCode = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); + unset($ch); } else { $ctx = stream_context_create([ 'http' => [ diff --git a/src/App/CronManagementService.php b/src/App/CronManagementService.php index b567911f..00e8425a 100644 --- a/src/App/CronManagementService.php +++ b/src/App/CronManagementService.php @@ -486,7 +486,7 @@ final class CronManagementService $raw = curl_exec($ch); $status = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE); $error = curl_error($ch); - curl_close($ch); + unset($ch); if (!is_string($raw)) { throw new \RuntimeException($error !== '' ? $error : 'Cron-HTTP-Aufruf fehlgeschlagen.'); diff --git a/src/App/KeycloakAuth.php b/src/App/KeycloakAuth.php index df71dd9d..4e5bd38e 100644 --- a/src/App/KeycloakAuth.php +++ b/src/App/KeycloakAuth.php @@ -536,7 +536,7 @@ final class KeycloakAuth $raw = curl_exec($ch); $curlError = curl_error($ch); $statusCode = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE); - curl_close($ch); + unset($ch); if ($raw === false) { return [ diff --git a/src/App/LdapProvisioner.php b/src/App/LdapProvisioner.php index beaeb262..c22e5142 100644 --- a/src/App/LdapProvisioner.php +++ b/src/App/LdapProvisioner.php @@ -720,7 +720,18 @@ final class LdapProvisioner throw new RuntimeException('LDAP_HOST ist nicht gesetzt.'); } - $link = ldap_connect($host, $port); + $uri = preg_match('~^ldaps?://~i', $host) === 1 + ? $host + : 'ldap://' . $host; + $uriParts = parse_url($uri); + if (!is_array($uriParts) || !isset($uriParts['host'])) { + throw new RuntimeException('LDAP_HOST ist keine gueltige LDAP-URI oder Hostangabe.'); + } + if (!isset($uriParts['port'])) { + $uri = rtrim($uri, '/') . ':' . $port; + } + + $link = ldap_connect($uri); if ($link === false) { throw new RuntimeException('LDAP-Verbindung konnte nicht aufgebaut werden.'); diff --git a/start.md b/start.md index 9d199e43..5f69b3c9 100644 --- a/start.md +++ b/start.md @@ -1,4 +1,3 @@ -# Start Zentrale Einstiegsdatei fuer neue Chats und neue Arbeitsauftraege in `desktop.kusche.berlin`. diff --git a/system/addons/gitea-deploy-status/GiteaDeployStatusService.php b/system/addons/gitea-deploy-status/GiteaDeployStatusService.php index 9e8abd62..17dc5a9d 100644 --- a/system/addons/gitea-deploy-status/GiteaDeployStatusService.php +++ b/system/addons/gitea-deploy-status/GiteaDeployStatusService.php @@ -401,7 +401,7 @@ final class GiteaDeployStatusService $raw = curl_exec($ch); $status = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE); $error = curl_error($ch); - curl_close($ch); + unset($ch); if (!is_string($raw)) { throw new \RuntimeException($error !== '' ? $error : 'Leere Gitea-Antwort.');