Fix bug when variables key doesn't exist (#7429)

This commit is contained in:
Yuriy Belenko 2020-09-20 15:49:00 +03:00 committed by GitHub
parent 80bef2f79a
commit 5675d5fe61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -482,7 +482,7 @@ class Configuration
$url = $host["url"];
// go through variable and assign a value
foreach ($host["variables"] as $name => $variable) {
foreach ($host["variables"] ?? [] as $name => $variable) {
if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user
if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum
$url = str_replace("{".$name."}", $variables[$name], $url);

View File

@ -499,7 +499,7 @@ class Configuration
$url = $host["url"];
// go through variable and assign a value
foreach ($host["variables"] as $name => $variable) {
foreach ($host["variables"] ?? [] as $name => $variable) {
if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user
if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum
$url = str_replace("{".$name."}", $variables[$name], $url);