firmware: extract subscription during migration #4881

We need it to better distinguish data during model validation
against repository definitions.
This commit is contained in:
Franco Fichtner 2023-03-08 21:38:07 +01:00
parent 4c65524322
commit e79a8a1af0

View File

@ -41,5 +41,12 @@ class M1_0_1 extends BaseModelMigration
if (in_array((string)$model->flavour, ['latest', 'libressl'])) {
$model->flavour = null;
}
if (!empty((string)$model->mirror)) {
$is_business = stripos((string)$model->mirror, 'opnsense-update.deciso.com') > 1;
if ($is_business) {
$url = explode('/', (string)$model->mirror);
$model->subscription = array_pop($url);
}
}
}
}