mirror of
https://github.com/kmvan/x-prober.git
synced 2026-04-22 01:08:59 +08:00
fix array_find functin in php5.4 error
This commit is contained in:
@@ -32,12 +32,13 @@ final class NodesAction
|
||||
|
||||
private function getNodeData($nodeId)
|
||||
{
|
||||
$node = array_find(NodesApi::getUserConfigNodes(), function ($item) use ($nodeId) {
|
||||
$nodes = array_filter(NodesApi::getUserConfigNodes(), function ($item) use ($nodeId) {
|
||||
return isset($item['url']) && isset($item['id']) && $item['id'] === $nodeId;
|
||||
});
|
||||
if ( ! $node) {
|
||||
if ( ! $nodes) {
|
||||
return;
|
||||
}
|
||||
$node = $nodes[0];
|
||||
$isDev = \defined('XPROBER_IS_DEV') && XPROBER_IS_DEV;
|
||||
$url = $node['url'];
|
||||
$isRemote = ( ! str_contains($url, 'localhost') || ! str_contains($url, '127.0.0.1'));
|
||||
|
||||
Reference in New Issue
Block a user