mirror of
https://github.com/unraid/api.git
synced 2026-01-01 06:01:18 -06:00
fix: combinedKnownOrigins in state.php for UPC
This commit is contained in:
@@ -137,7 +137,6 @@ class ServerState
|
||||
|
||||
$allowedOrigins = $this->myServersMemoryCfg['allowedOrigins'] ?? "";
|
||||
$extraOrigins = $this->myServersFlashCfg['api']['extraOrigins'] ?? "";
|
||||
|
||||
// if the current host is not in the allowed origins list and extra origins list, display a warning
|
||||
if (stripos($allowedOrigins.",", "/".$this->host.",") === false && stripos($extraOrigins.",", "/".$this->host.",") === false) {
|
||||
$this->combinedKnownOrigins = explode(", ", $allowedOrigins);
|
||||
@@ -155,6 +154,10 @@ class ServerState
|
||||
unset($this->combinedKnownOrigins[$key]);
|
||||
}
|
||||
}
|
||||
// for some reason the unset creates an associative array, so reindex the array with just the values. Otherwise we get an object passed to the UPC JS instead of an array.
|
||||
if ($this->combinedKnownOrigins) {
|
||||
$this->combinedKnownOrigins = array_values($this->combinedKnownOrigins);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user