mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
fix(appsmanagement): Fix exception on generating preview url for screenshots
Some installed apps meant for older server versions might unexpectedly offer up screenshot values in a non-string format (e.g. health). Avoid an exception by checking first if the first app screenshot is indeed a string and otherwise we take the value of the parameter Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
parent
9bb42ef557
commit
a4e2a7bb7b
1 changed files with 8 additions and 2 deletions
|
|
@ -254,9 +254,15 @@ class AppSettingsController extends Controller {
|
|||
$apps = $appClass->listAllApps();
|
||||
foreach ($apps as $app) {
|
||||
$app['installed'] = true;
|
||||
// locally installed apps have a flatted screenshot property
|
||||
|
||||
if (isset($app['screenshot'][0])) {
|
||||
$app['screenshot'] = $this->createProxyPreviewUrl($app['screenshot'][0]);
|
||||
$appScreenshot = $app['screenshot'][0] ?? null;
|
||||
if (is_array($appScreenshot)) {
|
||||
// Screenshot with thumbnail
|
||||
$appScreenshot = $appScreenshot['@value'];
|
||||
}
|
||||
|
||||
$app['screenshot'] = $this->createProxyPreviewUrl($appScreenshot);
|
||||
}
|
||||
$this->allApps[$app['id']] = $app;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue