diff options
| author | 2024-03-05 10:30:40 +0100 | |
|---|---|---|
| committer | 2024-03-05 10:30:40 +0100 | |
| commit | 9711f1477de7e2d8771501336adff3abef073e7b (patch) | |
| tree | 07632f438ca9de8bf21a15de848c8db19f468bc7 | |
| parent | da43fff43713daadbf13d05557a2ba14d5166b11 (diff) | |
version_compare raise exception if param is not a string (#6155)
* in file "metadata.json" it's possible that the data of version is not a string. in this case the check of the version raise an exception.
* Apply suggestions from code review
---------
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
| -rw-r--r-- | app/views/extension/index.phtml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/views/extension/index.phtml b/app/views/extension/index.phtml index 7bec7b233..b0267424a 100644 --- a/app/views/extension/index.phtml +++ b/app/views/extension/index.phtml @@ -61,11 +61,11 @@ <td> <?= $ext['description'] ?> <?php if (isset($this->extensions_installed[$ext['name']])) { ?> - <?php if (version_compare($this->extensions_installed[$ext['name']], $ext['version']) >= 0) { ?> + <?php if (version_compare(strval($this->extensions_installed[$ext['name']]), strval($ext['version'])) >= 0) { ?> <span class="alert alert-success"> <?= _t('admin.extensions.latest') ?> </span> - <?php } elseif ($this->extensions_installed[$ext['name']] != $ext['version']) { ?> + <?php } elseif (strval($this->extensions_installed[$ext['name']]) !== strval($ext['version'])) { ?> <span class="alert alert-warn"> <?= _t('admin.extensions.update') ?> </span> |
