mirror of
https://github.com/YGGverse/parser-php.git
synced 2026-04-01 17:55:29 +00:00
Compare commits
No commits in common. "main" and "0.3.0" have entirely different histories.
4 changed files with 13 additions and 15 deletions
|
|
@ -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
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Yggverse\Parser;
|
namespace YGGverse\Parser;
|
||||||
|
|
||||||
class Url {
|
class Url {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Yggverse\Parser;
|
namespace YGGverse\Parser;
|
||||||
|
|
||||||
class Urn {
|
class Urn {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Yggverse\Parser\Tests;
|
namespace YGGverse\Parser\Tests;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue