mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 16:44:39 +00:00
src: whitespace sweep
This commit is contained in:
parent
2351f17c33
commit
0798b98a16
@ -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()];
|
||||
|
||||
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)) {
|
||||
|
||||
@ -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)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user