Commit 763a7d5e authored by Côme Chilliet's avatar Côme Chilliet

Fixes #5655 PHP error in OPSI import when IP is empty

parent d3030970
......@@ -84,10 +84,12 @@ class systemImport extends simplePlugin
$baseObject = $tabObject->getBaseObject();
$baseObject->cn = $cn;
$baseObject->description = $host['description'];
if (!is_array($host['ipAddress'])) {
$host['ipAddress'] = array($host['ipAddress']);
if (!empty($host['ipAddress'])) {
if (!is_array($host['ipAddress'])) {
$host['ipAddress'] = array($host['ipAddress']);
}
$baseObject->ipHostNumber = $host['ipAddress'];
}
$baseObject->ipHostNumber = $host['ipAddress'];
$baseObject->macAddress = $host['hardwareAddress'];
/* Get existing DHCP servers */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment