Update j_plugins.php

Delete the file after closing the ZipArchive
This commit is contained in:
Hani Rouatbi
2023-07-01 18:24:08 +01:00
parent 2baa15bae7
commit d0bee08e8a

View File

@@ -657,9 +657,6 @@ switch ($case):
{
if ($zip->extractTo(PATH . KLEEJA_PLUGINS_FOLDER))
{
// we dont need the zip file anymore
kleeja_unlink(PATH . 'cache/' . $plugin_name . '.zip');
// uploaded plugin's archive has different name, so we change it
rename(
PATH . KLEEJA_PLUGINS_FOLDER . '/' . trim($zip->getNameIndex(0), '/'),
@@ -668,6 +665,9 @@ switch ($case):
$zip->close();
// we dont need the zip file anymore
kleeja_unlink(PATH . 'cache/' . $plugin_name . '.zip');
// download or update msg
$adminAjaxContent = '1:::' . sprintf($lang[$is_update ? 'ITEM_UPDATED' : 'ITEM_DOWNLOADED'], $plugin_name);