Check ZipArchive is available before showing list of installable plugins

This commit is contained in:
mattpass
2021-04-05 11:36:19 +01:00
parent f27905404b
commit 0850127d2b

View File

@@ -218,8 +218,14 @@ function deletePlugin($dir) {
<h2><?php echo $t['Install'] . ' / ' . $t['Uninstall'];?></h2><br>
<?php
// ZipArchive plugin not available
if (false === class_exists('ZipArchive')) {
echo "Sorry, you don't have the ZipArchive class in your PHP installation, or it's not enabled in php.ini.";
// Cannot get data? Show error info
} elseif (0 === count($pluginsData)) {
echo "Sorry, unable to get plugin data. Please make sure you have either curl or fopen available on your server.";
// Show list of plugins
if (0 < count($pluginsData)) {
} else {
?>
<table>
<?php
@@ -249,9 +255,6 @@ function deletePlugin($dir) {
</table>
<?php
// Cannot get data? Show error info
} else {
die("Sorry, unable to get plugin data. Please make sure you have either curl or fopen available on your server.");
}
?>
</div>