diff --git a/VERSION b/VERSION index 966fa8e..a3a5ea5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2309.152202 +0.2309.152244 diff --git a/src/Serialisation/Bencode.php b/src/Serialisation/Bencode.php index ea42f42..4aa93e9 100644 --- a/src/Serialisation/Bencode.php +++ b/src/Serialisation/Bencode.php @@ -1,11 +1,13 @@ seek(0); - } + } elseif(is_resource($input)) + $input = new GenericStream($input); + elseif(!($input instanceof Stream)) + throw new InvalidArgumentException('$input must be a string, an Index Stream or a file resource.'); if($depth < 1) throw new RuntimeException('Maximum depth reached, structure is too dense.');