fix warnings specific to PHP 7.3
authorDenis Ovsienko <denis@ovsienko.info>
Thu, 21 Mar 2019 00:09:00 +0000 (00:09 +0000)
committerDenis Ovsienko <denis@ovsienko.info>
Thu, 21 Mar 2019 00:09:00 +0000 (00:09 +0000)
PHP Warning:  "continue" targeting switch is equivalent to "break". Did
you mean to use "continue 2"?

* jun10ReadInterfaceStatus()
* addMultiPorts()
* addRealServers()

wwwroot/inc/deviceconfig.php
wwwroot/inc/ophandlers.php

index d49dc13..e585c27 100644 (file)
@@ -3110,7 +3110,7 @@ function jun10ReadInterfaceStatus ($input)
                                        break 2;
                                $field_list = preg_split('/\s+/', $line);
                                if (count ($field_list) < 3)
-                                       continue;
+                                       continue 2;
                                $portname = $field_list[0];
                                $admin_status = ($field_list[1] == 'up' || $field_list[1] == 'down') ? $field_list[1] : 'disabled';
                                $link_status = ($field_list[2] == 'up' || $field_list[2] == 'down') ? $field_list[2] : 'disabled';
index 84c2c7a..09bef7e 100644 (file)
@@ -811,7 +811,7 @@ function addMultiPorts ()
                        case 'ssv1':
                                $words = explode (' ', $line);
                                if ($words[0] == '') // empty L2 address is OK
-                                       continue;
+                                       continue 2;
                                $ports[] = array
                                (
                                        'name' => $words[0],
@@ -1592,23 +1592,23 @@ function addRealServers ()
                        case 'ipvs_2': // address and port only
                                if (!preg_match ('/^  -> ([0-9\.]+):([0-9]+) /', $line, $match))
                                        if (!preg_match ('/^  -> \[([0-9a-fA-F:]+)\]:([0-9]+) /', $line, $match))
-                                               continue;
+                                               continue 2;
                                addRStoRSPool (getBypassValue(), ip_parse ($match[1]), $match[2], getConfigVar ('DEFAULT_IPV4_RS_INSERVICE'), '');
                                break;
                        case 'ipvs_3': // address, port and weight
                                if (!preg_match ('/^  -> ([0-9\.]+):([0-9]+) +[a-zA-Z]+ +([0-9]+) /', $line, $match))
                                        if (!preg_match ('/^  -> \[([0-9a-fA-F:]+)\]:([0-9]+) +[a-zA-Z]+ +([0-9]+) /', $line, $match))
-                                               continue;
+                                               continue 2;
                                addRStoRSPool (getBypassValue(), ip_parse ($match[1]), $match[2], getConfigVar ('DEFAULT_IPV4_RS_INSERVICE'), 'weight ' . $match[3]);
                                break;
                        case 'ssv_2': // IP address and port
                                if (!preg_match ('/^([0-9\.a-fA-F:]+) ([0-9]+)$/', $line, $match))
-                                       continue;
+                                       continue 2;
                                addRStoRSPool (getBypassValue(), ip_parse ($match[1]), $match[2], getConfigVar ('DEFAULT_IPV4_RS_INSERVICE'), '');
                                break;
                        case 'ssv_1': // IP address
                                if (! $ip_bin = ip_checkparse ($line))
-                                       continue;
+                                       continue 2;
                                addRStoRSPool (getBypassValue(), $ip_bin, 0, getConfigVar ('DEFAULT_IPV4_RS_INSERVICE'), '');
                                break;
                        default: