From c32a3b5f7d76c9d6c74c9fd9b7d472ac3d3454c3 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 4 Sep 2023 01:38:55 +0300 Subject: [PATCH] add trim to filterInfoHash method --- src/Magnet.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Magnet.php b/src/Magnet.php index 2f4198c..3dfd588 100644 --- a/src/Magnet.php +++ b/src/Magnet.php @@ -21,14 +21,16 @@ class Magnet { public static function filterInfoHash(string $value) : string { - return str_replace( - [ - 'urn:', - 'btih:', - 'btmh:', - ], - false, - $value + return trim( + str_replace( + [ + 'urn:', + 'btih:', + 'btmh:', + ], + false, + $value + ) ); }