diff --git a/app/admin/powerDNS/refresh-ptr-records-submit.php b/app/admin/powerDNS/refresh-ptr-records-submit.php index 64f99260323f3a1b07b9549a1412a7bb882b3115..9293b00de941912dc21969196083d9fe2b08de54 100644 --- a/app/admin/powerDNS/refresh-ptr-records-submit.php +++ b/app/admin/powerDNS/refresh-ptr-records-submit.php @@ -59,6 +59,9 @@ $Addresses->ptr_unlink_subnet_addresses ($subnet->id); // fetch all hosts $hosts = $Addresses->fetch_subnet_addresses ($subnet->id, "ip_addr", "asc"); +// ignored +$ignored = []; + // create PTR records if (is_array($hosts) && sizeof($hosts)>0) { foreach ($hosts as $h) { diff --git a/app/subnets/addresses/print-address-table.php b/app/subnets/addresses/print-address-table.php index 50ebe3b4eecf4950a83fc18fc1874c4820bd2dec..4e4f09e7f1a58913ef73df847e3f07d9e1c2c403 100644 --- a/app/subnets/addresses/print-address-table.php +++ b/app/subnets/addresses/print-address-table.php @@ -263,7 +263,7 @@ else { # status icon if($subnet['pingSubnet']=="1") { //calculate - $tDiff = time() - strtotime($addresses[$n]->lastSeen); + $tDiff = !is_null($addresses[$n]->lastSeen)>0 ? time() - strtotime($addresses[$n]->lastSeen) : time(); if($addresses[$n]->excludePing=="1" ) { $hStatus = "padded"; $hTooltip = ""; } elseif(is_null($addresses[$n]->lastSeen)) { $hStatus = "neutral"; $hTooltip = "rel='tooltip' data-container='body' data-html='true' data-placement='left' title='"._("Address was never online")."'"; } elseif($addresses[$n]->lastSeen == "0000-00-00 00:00:00") { $hStatus = "neutral"; $hTooltip = "rel='tooltip' data-container='body' data-html='true' data-placement='left' title='"._("Address is offline")."<hr>"._("Last seen").": "._("Never")."'";} diff --git a/functions/checks/check_php_build.php b/functions/checks/check_php_build.php index 514f230e4f36c55481e513e4da4b03a4f04b13c5..a3237bb5b118709c28688a388b8e925b737c557f 100755 --- a/functions/checks/check_php_build.php +++ b/functions/checks/check_php_build.php @@ -15,7 +15,7 @@ if(!defined('PHPIPAM_PHP_MIN')) define('PHPIPAM_PHP_MIN', "5.4"); if(!defined('PHPIPAM_PHP_UNTESTED')) -define('PHPIPAM_PHP_UNTESTED', "8.2"); // PHP 8.2 or greater is untested & unsupported +define('PHPIPAM_PHP_UNTESTED', "9.0"); // PHP 8.2 or greater is untested & unsupported if (phpversion() >= PHPIPAM_PHP_UNTESTED) { $_SESSION['footer_warnings']['php_version'] = _('Unsupported PHP version ') . phpversion(); diff --git a/functions/classes/class.Common.php b/functions/classes/class.Common.php index f6927f564e4492293ce4481ed74ae8e327650e3a..2c22f7c1ba50ab75de0c11ebfb71e40720699bba 100644 --- a/functions/classes/class.Common.php +++ b/functions/classes/class.Common.php @@ -1168,7 +1168,11 @@ class Common_functions { * @param bool $permit_root_domain * @return bool|mixed */ - public function validate_hostname($hostname, $permit_root_domain=true) { + public function validate_hostname($hostname = "", $permit_root_domain=true) { + // null hostname is invalid + if(is_null($hostname)) { + return false; + } // first validate hostname $valid = (preg_match("/^([a-z_\d](-*[a-z_\d])*)(\.([a-z_\d](-*[a-z_\d])*))*$/i", $hostname) //valid chars check && preg_match("/^.{1,253}$/", $hostname) //overall length check diff --git a/functions/classes/class.PDO.php b/functions/classes/class.PDO.php index fe2af1e7d7a5268be7736384464420b3184bc426..ba2d379e939410998ad388837bfd6c86a0156d99 100644 --- a/functions/classes/class.PDO.php +++ b/functions/classes/class.PDO.php @@ -307,7 +307,7 @@ abstract class DB { return $this->ctes_enabled; $db = Config::ValueOf("db"); - $ctes_enabled = filter_var($db['use_cte'], FILTER_VALIDATE_INT, ['options'=>['default' => 1, 'min_range' => 0, 'max_range' => 2]]); + $ctes_enabled = filter_var(@$db['use_cte'], FILTER_VALIDATE_INT, ['options'=>['default' => 1, 'min_range' => 0, 'max_range' => 2]]); if ($ctes_enabled===0) { // Disable CTE Support $this->ctes_enabled = false; @@ -380,7 +380,7 @@ abstract class DB { * Reset engine type if set in config.php (MEMORY or InnoDB) */ $db = Config::ValueOf('db'); - $tmptable_engine_type = ($db['tmptable_engine_type']=="InnoDB") ? "InnoDB" : "MEMORY"; + $tmptable_engine_type = (@$db['tmptable_engine_type']=="InnoDB") ? "InnoDB" : "MEMORY"; try { // Emulate SQL CTE query using temporary tables.