mirror of
https://github.com/kmvan/x-prober.git
synced 2026-10-15 07:33:25 +08:00
fix deprecated
This commit is contained in:
@@ -12,7 +12,7 @@ final class Action
|
||||
{
|
||||
// delay for server benchmark
|
||||
(new ServerBenchmarkDelay())->delay();
|
||||
$action = (string) filter_input(\INPUT_GET, 'action', \FILTER_DEFAULT);
|
||||
$action = (string) filter_input(\INPUT_GET, 'action');
|
||||
if ( !$action) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ final class NodesAction
|
||||
if (NodesConstants::ID !== $action) {
|
||||
return;
|
||||
}
|
||||
$nodeId = filter_input(\INPUT_GET, 'nodeId', \FILTER_DEFAULT);
|
||||
$nodeId = filter_input(\INPUT_GET, 'nodeId');
|
||||
$response = new RestResponse();
|
||||
if ( !$nodeId) {
|
||||
$response
|
||||
@@ -41,7 +41,7 @@ final class NodesAction
|
||||
}
|
||||
$isDev = \defined('XPROBER_IS_DEV') && XPROBER_IS_DEV;
|
||||
$url = $node['url'];
|
||||
$isRemote = ( !str_contains($url, 'localhost') || !str_contains($url, '127.0.0.1'));
|
||||
$isRemote = (false === strpos($url, 'localhost') && false === strpos($url, '127.0.0.1'));
|
||||
$params = 'action=poll';
|
||||
$url = ($isDev && !$isRemote) ? "{$url}/api?{$params}" : "{$url}?{$params}";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user