From: Michael M Slusarz Date: Tue, 18 Jan 2011 07:43:48 +0000 (-0700) Subject: Cleaner creation of hash fingerprint X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a1f8c34468cc8f1a53e4b9a181bdb2ac69777782;p=horde.git Cleaner creation of hash fingerprint --- 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"));