From 175239716114d3e0087a536f6a50c466cae2b402 Mon Sep 17 00:00:00 2001 From: Jukka Lampikoski Date: Thu, 12 Mar 2026 22:56:37 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20ZammadClient=20lis=C3=A4=C3=A4=20https:/?= =?UTF-8?q?/=20automaattisesti=20URL:iin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kun Zammad-URL syötettiin ilman protokollaa (esim. desk.web1.fi), cURL ei osannut muodostaa oikeaa osoitetta ja synkronointi epäonnistui. Co-Authored-By: Claude Opus 4.6 --- api.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api.php b/api.php index 9f4798b..9b8fdc7 100644 --- a/api.php +++ b/api.php @@ -241,7 +241,12 @@ class ZammadClient { private string $token; public function __construct(string $url, string $token) { - $this->url = rtrim($url, '/'); + $url = rtrim($url, '/'); + // Lisää https:// jos protokolla puuttuu + if (!preg_match('#^https?://#i', $url)) { + $url = 'https://' . $url; + } + $this->url = $url; $this->token = $token; }