Skip to content

Commit

Permalink
Fix parsing inline PGP signed messages.
Browse files Browse the repository at this point in the history
Since PHP 7 the internal array pointer doesn't change anymore when using foreach.

Bug: 14352
  • Loading branch information
yunosh committed Nov 15, 2016
1 parent dbba6ac commit c98118a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/Crypt/lib/Horde/Crypt/Pgp/Parse.php
Expand Up @@ -159,7 +159,7 @@ public function parseToPart($text, $charset = 'UTF-8')
$new_part = new Horde_Mime_Part();
$new_part->setType('multipart/mixed');

foreach ($parts as $val) {
while (list(,$val) = each($parts)) {
switch ($val['type']) {
case self::ARMOR_TEXT:
$part = new Horde_Mime_Part();
Expand Down Expand Up @@ -198,7 +198,7 @@ public function parseToPart($text, $charset = 'UTF-8')
break;

case self::ARMOR_SIGNED_MESSAGE:
if (($sig = current($parts)) &&
if ((list(,$sig) = each($parts)) &&
($sig['type'] == self::ARMOR_SIGNATURE)) {
$part = new Horde_Mime_Part();
$part->setType('multipart/signed');
Expand Down

0 comments on commit c98118a

Please sign in to comment.