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
|
|
@ -17,7 +17,7 @@ $response = (object)
|
|||
];
|
||||
|
||||
// Yggdrasil connections only
|
||||
if (!preg_match(YGGDRASIL_HOST_REGEX, $_SERVER['REMOTE_ADDR']))
|
||||
if (!Valid::host($_SERVER['REMOTE_ADDR']))
|
||||
{
|
||||
$response->success = false;
|
||||
$response->message = _('Yggdrasil connection required for this action');
|
||||
|
|
@ -146,7 +146,7 @@ else
|
|||
$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;
|
||||
}
|
||||
|
|
@ -176,7 +176,7 @@ else
|
|||
$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;
|
||||
}
|
||||
|
|
@ -206,7 +206,7 @@ else
|
|||
$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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue