From c9768fef8b73e8a038444640ab0b64e6782edf6b Mon Sep 17 00:00:00 2001 From: Mathieu Trossevin Date: Tue, 31 Oct 2023 10:23:32 +0100 Subject: [PATCH] Fix some of the docblocks --- inc/common.php | 6 ++++++ lib/letsencrypt.php | 20 +++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/inc/common.php b/inc/common.php index 129ae90..b730a63 100644 --- a/inc/common.php +++ b/inc/common.php @@ -48,6 +48,12 @@ function is_superadmin() { } } +/** + * execute a command with sudo + * @param string $cmd The command that will be executed. + * @param ?array $output see $output parameter of exec(). + * @param ?int $return_var see $result_code parameter of exec(). + */ function sudoexec($cmd, &$output, &$return_var) { global $conf; diff --git a/lib/letsencrypt.php b/lib/letsencrypt.php index 8c0d2d4..83f1010 100644 --- a/lib/letsencrypt.php +++ b/lib/letsencrypt.php @@ -30,7 +30,7 @@ class LetsEncrypt /** * generate a CSR * @param string $vhost - * @param Array $domains + * @param array $domains * @return boolean */ public function makeCsr($vhost, $domains) @@ -69,7 +69,7 @@ class LetsEncrypt /** * perform a cURL call on the remote resource * the cURL call follows redirections - * @param Array $domains list of domains + * @param array $domains list of domains * @return boolean */ public function checkRemoteResourceAvailability($domain) @@ -108,8 +108,8 @@ class LetsEncrypt /** * Query the corresponding IP for each domain - * @param Array $domains list of HTTP checked domains - * @return Array $valid_dns_domains list of valid domains + * @param array $domains list of HTTP checked domains + * @return array $valid_dns_domains list of valid domains */ public function checkDNSValidity($domains) { @@ -151,7 +151,7 @@ class LetsEncrypt /** * Retrieve the SSL certificate from the URL * @param string $domain - * @return Array|false $cont list of parameters of the certificate, or false + * @return array|false $cont list of parameters of the certificate, or false */ public function getCertificate($domain) { @@ -164,8 +164,8 @@ class LetsEncrypt /** * Parse the certificat arguments and extract data - * @param Array $certificateParameters certificat arguments - * @return Array $infosCert contains only the issuer, domains and expiration date + * @param array $certificateParameters certificat arguments + * @return array $infosCert contains only the issuer, domains and expiration date */ public function parseCertificate($certificateParameters) { @@ -204,6 +204,12 @@ class LetsEncrypt return ($timestampCertValidUntil > $currentDate) ? true : false; } + /** + * Check if the requested domain is included in the certificate + * @param string $domainRequested + * @param array|string $san + * @return bool + */ public function isDomainIncludedInCert($domainRequested, $san) { $san = preg_replace('/DNS:| DNS:/', '', $san);