From e2bd851a6cde59270a68c666577798d85b77fbdd Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 18 Nov 2008 20:54:27 -0700 Subject: [PATCH] Make sure all EOL chars have been stripped. --- framework/Crypt/lib/Horde/Crypt/pgp.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/Crypt/lib/Horde/Crypt/pgp.php b/framework/Crypt/lib/Horde/Crypt/pgp.php index 76604d323..a43d2f21d 100644 --- a/framework/Crypt/lib/Horde/Crypt/pgp.php +++ b/framework/Crypt/lib/Horde/Crypt/pgp.php @@ -676,7 +676,8 @@ class Horde_Crypt_pgp extends Horde_Crypt * 'type' - (integer) The type of data contained in block. * Valid types are defined at the top of this class * (the ARMOR_* constants). - * 'data' - (array) The data for each section. + * 'data' - (array) The data for each section. Each line has been stripped + * of EOL characters. * */ public function parsePGPData($text) @@ -688,6 +689,7 @@ class Horde_Crypt_pgp extends Horde_Crypt $buffer = explode("\n", $text); while (list(,$val) = each($buffer)) { + $val = rtrim($val, "\r"); if (preg_match('/^-----(BEGIN|END) PGP ([^-]+)-----\s*$/', $val, $matches)) { if (isset($temp_array['data'])) { $data[] = $temp_array; -- 2.11.0