diff --git a/src/opnsense/mvc/app/config/AppConfig.php b/src/opnsense/mvc/app/config/AppConfig.php index fc3e4a7f7..676d5e36f 100644 --- a/src/opnsense/mvc/app/config/AppConfig.php +++ b/src/opnsense/mvc/app/config/AppConfig.php @@ -43,7 +43,7 @@ class AppConfig /** * construct new application config object, keep $data when not offered. */ - public function __construct($new_data=null) + public function __construct($new_data = null) { if ($new_data != null) { self::$data = $new_data; @@ -94,4 +94,4 @@ class AppConfig self::$obj = json_decode(json_encode(self::$data)); return true; } -} \ No newline at end of file +} diff --git a/src/opnsense/mvc/app/config/config.php b/src/opnsense/mvc/app/config/config.php index b4f50b822..4b40e2474 100644 --- a/src/opnsense/mvc/app/config/config.php +++ b/src/opnsense/mvc/app/config/config.php @@ -1,4 +1,5 @@ gettext('ARC'), ], 'disk' => [ - 'title' => gettext ('Disk usage'), + 'title' => gettext('Disk usage'), 'used' => gettext('Used'), 'free' => gettext('Free'), ] diff --git a/src/opnsense/mvc/app/library/OPNsense/Core/Csrf.php b/src/opnsense/mvc/app/library/OPNsense/Core/Csrf.php index 03022799f..9a5ef47ec 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Core/Csrf.php +++ b/src/opnsense/mvc/app/library/OPNsense/Core/Csrf.php @@ -34,7 +34,7 @@ class Csrf * Generate a random URL-safe base64 string. * Usable base64 characters according to https://www.ietf.org/rfc/rfc3548.txt */ - public function base64Safe($len=16) + public function base64Safe($len = 16) { return rtrim(strtr(base64_encode(random_bytes($len)), "+/", "-_"), '='); } @@ -55,4 +55,4 @@ class Csrf 'key' => $_SESSION['$PHALCON/CSRF/KEY$'] ]; } -} \ No newline at end of file +} diff --git a/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/AliasNameField.php b/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/AliasNameField.php index 58202f9f8..00fafde0c 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/AliasNameField.php +++ b/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/AliasNameField.php @@ -73,10 +73,12 @@ class AliasNameField extends BaseField "callback" => function ($value) use ($reservedwords) { $result = []; /* avoids single "_" and prefixes of "__" here too */ - if (!preg_match( - '/^([a-zA-Z]|(([_a-zA-Z][a-zA-Z0-9]|[a-zA-Z][_a-zA-Z0-9])[_a-zA-Z0-9]{0,29}))$/', - $value - )) { + if ( + !preg_match( + '/^([a-zA-Z]|(([_a-zA-Z][a-zA-Z0-9]|[a-zA-Z][_a-zA-Z0-9])[_a-zA-Z0-9]{0,29}))$/', + $value + ) + ) { $result[] = gettext('The name must start with a letter or single underscore, be less than 32 characters and only consist of alphanumeric characters or underscores.'); } if (in_array($value, $reservedwords)) { diff --git a/src/opnsense/mvc/tests/app/config/config.php b/src/opnsense/mvc/tests/app/config/config.php index e8fc6146e..ce4a2226f 100644 --- a/src/opnsense/mvc/tests/app/config/config.php +++ b/src/opnsense/mvc/tests/app/config/config.php @@ -1,4 +1,5 @@ assertInstanceOf('\OPNsense\Base\FieldTypes\AuthGroupField', new AuthGroupField()); // switch config to test set for this type - (new AppConfig())->update('globals.config_path', __DIR__ . '/AuthGroupFieldTest/'); + (new AppConfig())->update('globals.config_path', __DIR__ . '/AuthGroupFieldTest/'); Config::getInstance()->forceReload(); } diff --git a/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/AuthenticationServerFieldTest.php b/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/AuthenticationServerFieldTest.php index 581f4e20d..99d5c1cbd 100644 --- a/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/AuthenticationServerFieldTest.php +++ b/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/AuthenticationServerFieldTest.php @@ -47,7 +47,7 @@ class AuthenticationServerFieldTest extends Field_Framework_TestCase { $this->assertInstanceOf('\OPNsense\Base\FieldTypes\AuthenticationServerField', new AuthenticationServerField()); // switch config to test set for this type - (new AppConfig())->update('globals.config_path', __DIR__ . '/AuthenticationServerFieldTest/'); + (new AppConfig())->update('globals.config_path', __DIR__ . '/AuthenticationServerFieldTest/'); Config::getInstance()->forceReload(); } diff --git a/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/CertificateFieldTest.php b/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/CertificateFieldTest.php index 0f1c6bbc7..78ca235fb 100644 --- a/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/CertificateFieldTest.php +++ b/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/CertificateFieldTest.php @@ -47,7 +47,7 @@ class CertificateFieldTest extends Field_Framework_TestCase { $this->assertInstanceOf('\OPNsense\Base\FieldTypes\CertificateField', new CertificateField()); // switch config to test set for this type - (new AppConfig())->update('globals.config_path', __DIR__ . '/CertificateFieldTest/'); + (new AppConfig())->update('globals.config_path', __DIR__ . '/CertificateFieldTest/'); Config::getInstance()->forceReload(); } diff --git a/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/InterfaceFieldTest.php b/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/InterfaceFieldTest.php index 5cd14cec0..e37f40264 100644 --- a/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/InterfaceFieldTest.php +++ b/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/InterfaceFieldTest.php @@ -47,7 +47,7 @@ class InterfaceFieldTest extends Field_Framework_TestCase { $this->assertInstanceOf('\OPNsense\Base\FieldTypes\InterfaceField', new InterfaceField()); // switch config to test set for this type - (new AppConfig())->update('globals.config_path', __DIR__ . '/InterfaceFieldTest/'); + (new AppConfig())->update('globals.config_path', __DIR__ . '/InterfaceFieldTest/'); Config::getInstance()->forceReload(); } diff --git a/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/ModelRelationFieldTest.php b/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/ModelRelationFieldTest.php index 814dde21e..04325f4dd 100644 --- a/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/ModelRelationFieldTest.php +++ b/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/ModelRelationFieldTest.php @@ -41,7 +41,7 @@ class ModelRelationFieldTest extends Field_Framework_TestCase { protected function setUp(): void { - (new AppConfig())->update('globals.config_path', __DIR__ . '/ModelRelationFieldTest/'); + (new AppConfig())->update('globals.config_path', __DIR__ . '/ModelRelationFieldTest/'); Config::getInstance()->forceReload(); } diff --git a/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/NetworkAliasFieldTest.php b/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/NetworkAliasFieldTest.php index 2a6e9cc21..207df91cb 100644 --- a/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/NetworkAliasFieldTest.php +++ b/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/NetworkAliasFieldTest.php @@ -47,7 +47,7 @@ class NetworkAliasFieldTest extends Field_Framework_TestCase { $this->assertInstanceOf('\OPNsense\Base\FieldTypes\NetworkAliasField', new NetworkAliasField()); // switch config to test set for this type - (new AppConfig())->update('globals.config_path', __DIR__ . '/NetworkAliasFieldTest/'); + (new AppConfig())->update('globals.config_path', __DIR__ . '/NetworkAliasFieldTest/'); Config::getInstance()->forceReload(); } diff --git a/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/VirtualIPFieldTest.php b/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/VirtualIPFieldTest.php index 503da29c5..cb9458e7c 100644 --- a/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/VirtualIPFieldTest.php +++ b/src/opnsense/mvc/tests/app/models/OPNsense/Base/FieldTypes/VirtualIPFieldTest.php @@ -47,7 +47,7 @@ class VirtualIPFieldTest extends Field_Framework_TestCase { $this->assertInstanceOf('\OPNsense\Base\FieldTypes\VirtualIPField', new VirtualIPField()); // switch config to test set for this type - (new AppConfig())->update('globals.config_path', __DIR__ . '/VirtualIPFieldTest/'); + (new AppConfig())->update('globals.config_path', __DIR__ . '/VirtualIPFieldTest/'); Config::getInstance()->forceReload(); } diff --git a/src/opnsense/www/js/widgets/Disk.js b/src/opnsense/www/js/widgets/Disk.js index 3c087371e..9f1b6214f 100644 --- a/src/opnsense/www/js/widgets/Disk.js +++ b/src/opnsense/www/js/widgets/Disk.js @@ -244,5 +244,3 @@ export default class Disk extends BaseWidget { } } - -