src: whitespace sweep

This commit is contained in:
Franco Fichtner 2022-09-23 20:31:42 +02:00
parent 2351f17c33
commit 0798b98a16
4 changed files with 5 additions and 4 deletions

View File

@ -89,7 +89,8 @@ function filter_rules_sort()
/* strip the sequence numbers again, add uuid's where not available */
for ($i = 0; isset($config['filter']['rule'][$i]); $i++) {
unset($config['filter']['rule'][$i]['seq']);
if (empty($config['filter']['rule'][$i]['@attributes'])
if (
empty($config['filter']['rule'][$i]['@attributes'])
&& empty($config['filter']['rule'][$i]['@attributes']['uuid'])
) {
$config['filter']['rule'][$i]['@attributes'] = ['uuid' => generate_uuid()];

View File

@ -58,7 +58,7 @@ class VlanSettingsController extends ApiMutableModelControllerBase
/* auto-number new device */
$ifid = 0;
foreach ($this->getModel()->vlan->iterateItems() as $node) {
if (preg_match("/^({$prefix})(\d)*$/i",(string)$node->vlanif)) {
if (preg_match("/^({$prefix})(\d)*$/i", (string)$node->vlanif)) {
$ifid = max($ifid, (int)filter_var((string)$node->vlanif, FILTER_SANITIZE_NUMBER_INT));
}
}

View File

@ -53,7 +53,7 @@ class Vlan extends BaseModel
break;
} elseif (!(strpos((string)$node, (string)$prefix) === 0)) {
$messages->appendMessage(new Message(
sprintf(gettext("device name does not match type (e.g. %s_xxx)."), (string)$prefix) ,
sprintf(gettext("device name does not match type (e.g. %s_xxx)."), (string)$prefix),
$key
));
} elseif (!preg_match("/^([a-zA-Z0-9_]){1,16}$/", (string)$node)) {

View File

@ -43,7 +43,7 @@ if ($ret != null) {
$ret['product_repos'] = implode(', ', $repos);
$ret['product_check'] = json_decode(@file_get_contents('/tmp/pkg_upgrade.json'), true);
// for business editions, collect license information
if (preg_match('/\/[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}\//i', $product_mirror) && file_exists($licensefile)) {
if (preg_match('/\/[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}\//i', $product_mirror) && file_exists($licensefile)) {
$payload = file_get_contents($licensefile);
$payload = $payload !== false ? json_decode($payload, true) : null;
if (is_array($payload)) {