Skip to content

Commit 11987ca

Browse files
nbosbandi34
authored andcommitted
Migrate preview.url field in config
When the config has been created by a previous version, the preview.url field may contain values wrapped in `url("...")`. The updated version no longer requires this wrapper. If the preview.url field starts with `url(` and ends with `)`, the `url(...)` wrapper and any surrounding quotes are removed. Signed-off-by: Nils Bosbach <n.bosbach@gmx.de>
1 parent 80faa47 commit 11987ca

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Service/ConfigurationService.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ protected function processMigration(array $config): array
161161
$config['preview']['mode'] = 'device_cam';
162162
}
163163

164+
// Migrate Preview URL
165+
if (isset($config['preview']['url']) && substr($config['preview']['url'], 0, 4) === 'url(' && substr($config['preview']['url'], -1) === ')') {
166+
$config['preview']['url'] = trim(substr($config['preview']['url'], 4, -1), '"\'');
167+
}
168+
164169
return $config;
165170
}
166171

0 commit comments

Comments
 (0)