We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 313e2eb + 02b9e20 commit 9ada9f9Copy full SHA for 9ada9f9
includes/functions.php
@@ -177,15 +177,17 @@ function getDefaultNetOpts($svc,$key)
177
* @param string $key
178
* @return object $json
179
*/
180
-function getProviderValue($id,$key)
+function getProviderValue($id, $key)
181
{
182
$obj = json_decode(file_get_contents(RASPI_CONFIG_PROVIDERS), true);
183
- if ($obj === null) {
+ if (!isset($obj['providers']) || !is_array($obj['providers'])) {
184
+ return false;
185
+ }
186
+ $id--;
187
+ if (!isset($obj['providers'][$id]) || !is_array($obj['providers'][$id])) {
188
return false;
- } else {
- $id--;
- return $obj['providers'][$id][$key];
189
}
190
+ return $obj['providers'][$id][$key] ?? false;
191
192
193
/* Functions to write ini files */
0 commit comments