authorize8021QChangeRequests(): amend PHP array syntax
authorDenis Ovsienko <denis@ovsienko.info>
Sat, 4 May 2019 21:04:09 +0000 (22:04 +0100)
committerDenis Ovsienko <denis@ovsienko.info>
Sat, 4 May 2019 21:04:09 +0000 (22:04 +0100)
See Mantis#1905. Although support for PHP 5.3 is not a goal, the rest of
PHP code uses traditional array syntax, so let's make it consistent.

wwwroot/inc/functions.php

index 82ec6cb..297a2c2 100644 (file)
@@ -4822,7 +4822,7 @@ function authorize8021QChangeRequests ($before, $changes, $op = NULL)
        {
                if (! array_key_exists($pn, $before))
                {
-                       $removed = [];
+                       $removed = array();
                        $added = $new['allowed'];
                }
                else
@@ -4841,10 +4841,10 @@ function authorize8021QChangeRequests ($before, $changes, $op = NULL)
                        }
                }
                foreach ($removed as $vid)
-                       if (!permitted (NULL, NULL, $op, [['tag' => "\$fromvlan_{$vid}"], ['tag' => "\$vlan_{$vid}"]]))
+                       if (!permitted (NULL, NULL, $op, array (array ('tag' => "\$fromvlan_{$vid}"), array ('tag' => "\$vlan_{$vid}"))))
                                continue 2; // next port
                foreach ($added as $vid)
-                       if (!permitted (NULL, NULL, $op, [['tag' => "\$tovlan_{$vid}"], ['tag' => "\$vlan_{$vid}"]]))
+                       if (!permitted (NULL, NULL, $op, array (array ('tag' => "\$tovlan_{$vid}"), array ('tag' => "\$vlan_{$vid}"))))
                                continue 2; // next port
                $ret[$pn] = $new;
        }