From a1f8c34468cc8f1a53e4b9a181bdb2ac69777782 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 18 Jan 2011 00:43:48 -0700 Subject: [PATCH] Cleaner creation of hash fingerprint --- framework/Crypt/lib/Horde/Crypt/Smime.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/framework/Crypt/lib/Horde/Crypt/Smime.php b/framework/Crypt/lib/Horde/Crypt/Smime.php index 18c2aaafc..4acbab64f 100644 --- a/framework/Crypt/lib/Horde/Crypt/Smime.php +++ b/framework/Crypt/lib/Horde/Crypt/Smime.php @@ -619,11 +619,7 @@ class Horde_Crypt_Smime extends Horde_Crypt foreach ($cert_details['fingerprints'] as $hash => $fingerprint) { $label = sprintf(Horde_Crypt_Translation::t("%s Fingerprint"), Horde_String::upper($hash)); - $fingerprint_str = ''; - for ($i = 0, $f_len = strlen($fingerprint); $i < $f_len; $i += 2) { - $fingerprint_str .= substr($fingerprint, $i, 2) . ':'; - } - $text .= sprintf("  %s:\n      %s\n", $label, $fingerprint_str); + $text .= sprintf("  %s:\n      %s\n", $label, rtrim(chunk_split($fingerprint, 2, ':'), ':')); } $text .= sprintf("  %s: %s\n", Horde_Crypt_Translation::t("Signature Algorithm"), $cert_details['signatureAlgorithm']); $text .= sprintf("  %s:", Horde_Crypt_Translation::t("Signature")); -- 2.11.0