mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 09:35:28 +00:00
use common Valid library methods to check URL and addresses
This commit is contained in:
parent
eb43fb4b18
commit
43c617e893
13 changed files with 225 additions and 236 deletions
|
|
@ -103,7 +103,7 @@ if (API_EXPORT_PUSH_ENABLED)
|
|||
$uri = $db->getUri($addressTracker->uriId);
|
||||
|
||||
// Yggdrasil host only
|
||||
if (!preg_match(YGGDRASIL_HOST_REGEX, str_replace(['[',']'], false, $host->value)))
|
||||
if (!Valid::host($host->value))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -129,7 +129,7 @@ if (API_EXPORT_PUSH_ENABLED)
|
|||
$uri = $db->getUri($acceptableSource->uriId);
|
||||
|
||||
// Yggdrasil host only
|
||||
if (!preg_match(YGGDRASIL_HOST_REGEX, str_replace(['[',']'], false, $host->value)))
|
||||
if (!Valid::host($host->value))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -155,7 +155,7 @@ if (API_EXPORT_PUSH_ENABLED)
|
|||
$uri = $db->getUri($eXactSource->uriId);
|
||||
|
||||
// Yggdrasil host only
|
||||
if (!preg_match(YGGDRASIL_HOST_REGEX, str_replace(['[',']'], false, $host->value)))
|
||||
if (!Valid::host($host->value))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -310,12 +310,9 @@ if (API_EXPORT_PUSH_ENABLED)
|
|||
}
|
||||
|
||||
// Skip sending to non-condition addresses
|
||||
if ($pushUrl = Yggverse\Parser\Url::parse($manifest->import->push))
|
||||
if (!Valid::url($manifest->import->push))
|
||||
{
|
||||
if (!preg_match(YGGDRASIL_HOST_REGEX, str_replace(['[',']'], false, $pushUrl->host->name)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue