mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-11 09:09:28 +00:00
- ExtensionsLib->getInstalledExtensions returns only the extensions installed on the current server
- Better checks if no file has been uploaded
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user