- ExtensionsLib->getInstalledExtensions returns only the extensions installed on the current server

- Better checks if no file has been uploaded
This commit is contained in:
Paolo
2025-11-13 09:53:06 +01:00
parent bd50a9a141
commit 3e303a6617
2 changed files with 12 additions and 11 deletions
+11 -6
View File
@@ -111,11 +111,15 @@ class ExtensionsLib
$uploadData = $this->_uploadExtension(); // perform the upload of the file and returns info about it
}
// If the given filename is the upper directory or the current one
if (trim($uploadData->fullPath) == '..' || trim($uploadData->fullPath) == '.')
// If a file has been uploaded
if (isset($uploadData))
{
$this->_printFailure('wrong file name: / has to be escaped with %2F');
$uploadData = null; // then it is a wrong one!
// If the given filename is the upper directory or the current one
if (trim($uploadData->fullPath) == '..' || trim($uploadData->fullPath) == '.')
{
$this->_printFailure('wrong file name: / has to be escaped with %2F');
$uploadData = null; // then it is a wrong one!
}
}
// If the no error occurred
@@ -177,7 +181,8 @@ class ExtensionsLib
if ($this->_errorOccurred === false) // if no errors occurred
{
if (!$this->_rrm($uploadData->fullPath)) // removes uploaded file
// If a file has been uploaded then remove them
if (isset($uploadData) && !$this->_rrm($uploadData->fullPath))
{
$this->_printInfo('Error while cleaning upload directory. Not a blocking error');
}
@@ -243,7 +248,7 @@ class ExtensionsLib
$this->_ci->ExtensionsModel->addOrder('server_kurzbz', 'ASC');
$this->_ci->ExtensionsModel->addOrder('version', 'ASC');
return $this->_ci->ExtensionsModel->load();
return $this->_ci->ExtensionsModel->loadWhere(array('server_kurzbz' => SERVER_NAME));
}
/**