Permalink
Browse files

unpack returns an array

  • Loading branch information...
1 parent acdf5d1 commit 1333a1a035ab43b61ce04955804e2ba1e617d34a @singpolyma singpolyma committed Mar 31, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/openpgp.php
View
@@ -222,7 +222,7 @@ static function parse_new_format($input) {
return array($tag, 3, (($len - 192) << 8) + ord($input[2]) + 192);
}
if($len == 255) { // Five octet length
- return array($tag, 6, unpack('N', substr($input, 2, 4)));
+ return array($tag, 6, array_pop(unpack('N', substr($input, 2, 4))));
}
// TODO: Partial body lengths. 1 << ($len & 0x1F)
}
@@ -427,7 +427,7 @@ static function get_subpacket(&$input) {
}
if($len == 255) { // Five octet length
$length_of_length = 5;
- $len = unpack('N', substr($input, 1, 4));
+ $len = array_pop(unpack('N', substr($input, 1, 4)));
}
$input = substr($input, $length_of_length); // Chop off length header
$tag = ord($input[0]);

0 comments on commit 1333a1a

Please sign in to comment.