From b2275ce7b7bfbc2bb6c269c812327b1ea5a22380 Mon Sep 17 00:00:00 2001 From: Michal Politzer Date: Mon, 7 Oct 2024 11:57:41 +0200 Subject: [PATCH] PHP 8.3 compatibility resolved --- Lescript.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lescript.php b/Lescript.php index b81d01f..3109ab2 100644 --- a/Lescript.php +++ b/Lescript.php @@ -16,7 +16,7 @@ class Lescript // public $contact = array("mailto:cert-admin@example.com", "tel:+12025551212") public $clientUserAgent = "analogic-lescript/0.3.0"; - + protected $certificatesDir; protected $webRootDir; @@ -130,7 +130,7 @@ function ($domain) { $tokenPath = $directory . '/' . $challenge['token']; if (!file_exists($directory) && !@mkdir($directory, 0755, true)) { - throw new RuntimeException("Couldn't create directory to expose challenge: ${tokenPath}"); + throw new RuntimeException(sprintf("Couldn't create directory to expose challenge: %s", $tokenPath)); } $header = array( @@ -148,7 +148,7 @@ function ($domain) { // 3. verification process itself // ------------------------------- - $uri = "http://${domain}/.well-known/acme-challenge/${challenge['token']}"; + $uri = sprintf("http://%s/.well-known/acme-challenge/%s", $domain, $challenge['token']); $this->log("Token for $domain saved at $tokenPath and should be available at $uri"); $this->log("Sending request to challenge"); @@ -183,7 +183,7 @@ function ($domain) { throw new RuntimeException("Verification timed out"); } - $this->log("Verification ended with status: ${result['status']}"); + $this->log(sprintf("Verification ended with status: %s", $result['status'])); @unlink($tokenPath); }