Compare commits

..

No commits in common. "main" and "0.3.0" have entirely different histories.
main ... 0.3.0

4 changed files with 13 additions and 15 deletions

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Yggverse\Parser; namespace YGGverse\Parser;
class Magnet { class Magnet {
@ -16,21 +16,19 @@ class Magnet {
public static function isXTv2(string $xt) : bool public static function isXTv2(string $xt) : bool
{ {
return ('urn' == parse_url($xt, PHP_URL_SCHEME) && false !== strpos($xt, ':btmh:1220')); return ('urn' == parse_url($xt, PHP_URL_SCHEME) && false !== strpos($xt, ':btmh:'));
} }
public static function filterInfoHash(string $value) : string public static function filterInfoHash(string $value) : string
{ {
return trim( return str_replace(
str_replace( [
[ 'urn:',
'urn:', 'btih:',
'btih:', 'btmh:',
'btmh:1220', ],
], false,
false, $value
$value
)
); );
} }

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Yggverse\Parser; namespace YGGverse\Parser;
class Url { class Url {

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Yggverse\Parser; namespace YGGverse\Parser;
class Urn { class Urn {

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Yggverse\Parser\Tests; namespace YGGverse\Parser\Tests;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;