Use isset when checking that the key exists

To resolve errors like this:

Warning:  Undefined array key "example.net" in /usr/share/davical/inc/iSchedule.php on line 207
This commit is contained in:
Andrew Ruthven 2024-04-01 20:46:13 +13:00
parent 901d82a293
commit 7f2cccb94a

View File

@ -204,7 +204,7 @@ class iSchedule
function getServer ( )
{
global $icfg;
if ( isset($icfg) && $icfg [ $this->domain ] )
if ( isset($icfg) && isset($icfg[$this->domain]) )
{
$this->remote_server = $icfg [ $this->domain ] [ 'server' ];
$this->remote_port = $icfg [ $this->domain ] [ 'port' ];