mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
fix yggdrasil host validation
This commit is contained in:
parent
e3f312f6f3
commit
f3896534ae
7 changed files with 28 additions and 29 deletions
|
|
@ -140,7 +140,7 @@ $response = (object)
|
|||
];
|
||||
|
||||
// Yggdrasil connections only
|
||||
if (!preg_match(YGGDRASIL_URL_REGEX, $_SERVER['REMOTE_ADDR']))
|
||||
if (!preg_match(YGGDRASIL_HOST_REGEX, $_SERVER['REMOTE_ADDR']))
|
||||
{
|
||||
$response->success = false;
|
||||
$response->message = _('Yggdrasil connection required to enable resource features');
|
||||
|
|
@ -370,7 +370,7 @@ else {
|
|||
{
|
||||
if ($url = Yggverse\Parser\Url::parse($tr))
|
||||
{
|
||||
if (preg_match(YGGDRASIL_URL_REGEX, str_replace(['[',']'], false, $url->host->name)))
|
||||
if (preg_match(YGGDRASIL_HOST_REGEX, str_replace(['[',']'], false, $url->host->name)))
|
||||
{
|
||||
$db->initMagnetToAddressTrackerId(
|
||||
$magnet->magnetId,
|
||||
|
|
@ -406,7 +406,7 @@ else {
|
|||
{
|
||||
if ($url = Yggverse\Parser\Url::parse($as))
|
||||
{
|
||||
if (preg_match(YGGDRASIL_URL_REGEX, str_replace(['[',']'], false, $url->host->name)))
|
||||
if (preg_match(YGGDRASIL_HOST_REGEX, str_replace(['[',']'], false, $url->host->name)))
|
||||
{
|
||||
$db->initMagnetToAcceptableSourceId(
|
||||
$magnet->magnetId,
|
||||
|
|
@ -442,7 +442,7 @@ else {
|
|||
{
|
||||
if ($url = Yggverse\Parser\Url::parse($xs))
|
||||
{
|
||||
if (preg_match(YGGDRASIL_URL_REGEX, str_replace(['[',']'], false, $url->host->name)))
|
||||
if (preg_match(YGGDRASIL_HOST_REGEX, str_replace(['[',']'], false, $url->host->name)))
|
||||
{
|
||||
$db->initMagnetToExactSourceId(
|
||||
$magnet->magnetId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue