Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Commit

Permalink
fix(Bencode): Fix dict keys may not in sorted order
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed Jan 22, 2020
1 parent 1d8e9e4 commit 81f0783
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions application/Libraries/Bencode/Bencode.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public static function encode($data): string
}
} else {
$return .= 'd';
ksort($data, SORT_STRING);
foreach ($data as $key => $value) {
$return .= self::encode(strval($key));
$return .= self::encode($value);
Expand Down

0 comments on commit 81f0783

Please sign in to comment.