mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
firmware: unify this while at it #4881
This commit is contained in:
parent
68e5272cf1
commit
fc8fb4e289
@ -471,7 +471,7 @@ class AliasController extends ApiMutableModelControllerBase
|
||||
if (isset($cnf->system->firmware) && !empty($cnf->system->firmware->mirror)) {
|
||||
// XXX: we might add some attribute in firmware to store subscription status, since we now only store uri
|
||||
$result[static::$internalModelName]['geoip']['subscription'] =
|
||||
strpos($cnf->system->firmware->mirror, "opnsense-update.deciso.com") !== false;
|
||||
strpos($cnf->system->firmware->mirror, 'opnsense-update.deciso.com') !== false;
|
||||
}
|
||||
|
||||
$result[static::$internalModelName]['geoip']['address_count'] = 0;
|
||||
|
||||
@ -39,7 +39,7 @@ class M1_0_0 extends BaseModelMigration
|
||||
public function run($model)
|
||||
{
|
||||
if ((empty((string)$model->type) || (string)$model->type == 'devel') && !empty((string)$model->mirror)) {
|
||||
$is_business = stripos((string)$model->mirror, 'opnsense-update.deciso.com') > 1;
|
||||
$is_business = strpos((string)$model->mirror, 'opnsense-update.deciso.com') !== false;
|
||||
if ($is_business) {
|
||||
$model->type = 'business';
|
||||
$model->flavour = 'latest';
|
||||
|
||||
@ -42,7 +42,7 @@ class M1_0_1 extends BaseModelMigration
|
||||
$model->flavour = null;
|
||||
}
|
||||
if (!empty((string)$model->mirror)) {
|
||||
$is_business = stripos((string)$model->mirror, 'opnsense-update.deciso.com') > 1;
|
||||
$is_business = strpos((string)$model->mirror, 'opnsense-update.deciso.com') !== false;
|
||||
if ($is_business) {
|
||||
$url = explode('/', (string)$model->mirror);
|
||||
$model->subscription = array_pop($url);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user