r1739 + sortObjectAddressesAndNames(): don't generate PHP notices about unset indexes
authorDenis Ovsienko <infrastation@yandex.ru>
Thu, 28 Feb 2008 11:33:51 +0000 (11:33 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Thu, 28 Feb 2008 11:33:51 +0000 (11:33 +0000)
inc/functions.php

index a9ee97868613fec67c7f45859ecc8f6ba1a5989a..c53a1f35ad47aaafabd16634d0fe27cfc6aba0e9 100644 (file)
@@ -920,11 +920,11 @@ function sortObjectAddressesAndNames ($a, $b)
        $objname_cmp = sortTokenize($a['object_name'], $b['object_name']);
        if ($objname_cmp == 0)
        {
-               $objname_cmp = sortTokenize($a['port_name'], $b['port_name']);
+               $name_a = (isset ($a['port_name'])) ? $a['port_name'] : '';
+               $name_b = (isset ($b['port_name'])) ? $b['port_name'] : '';
+               $objname_cmp = sortTokenize($name_a, $name_b);
                if ($objname_cmp == 0)
-               {
                        sortTokenize($a['ip'], $b['ip']);
-               }
                return $objname_cmp;
        }
        return $objname_cmp;