From c823ff87ed32beeea6e0a49d194178db9944693d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 8 Apr 2025 14:42:51 +0200 Subject: [PATCH] global-functions: $CertificateNameByCN: return false without match... ... and return true on success. --- global-functions.rsc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 7b1c214..d014567 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -208,8 +208,12 @@ :global CleanName; :local Cert ([ /certificate/find where (common-name=$Match or fingerprint=$Match or name=$Match) ]->0); + :if ([ :len $Cert ] = 0) do={ + :return false; + } :local CommonName [ /certificate/get $Cert common-name ]; /certificate/set $Cert name=[ $CleanName $CommonName ]; + :return true; } # multiply given character(s)