global-functions: $CertificateNameByCN: return false without match...

... and return true on success.
This commit is contained in:
Christian Hesse 2025-04-08 14:42:51 +02:00
parent 44fa91f5c4
commit c823ff87ed

View file

@ -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)