Skip to content

Commit

Permalink
Generalize and more safely load postFlight() include
Browse files Browse the repository at this point in the history
  • Loading branch information
billtomczak committed Sep 7, 2021
1 parent 04fa347 commit ba6d365
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/admin/library/Free/Installer/AbstractScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,19 @@ public function postFlight($type, $parent)
parent::postFlight($type, $parent);

if ($type != 'uninstall') {
$this->checkParamStructure();
$this->checkAndCreateDefaultCategory();
$this->fixOrderingParamForMenus();
$this->fixDownloadsViewParams();
$this->fixItemViewParams();
$this->fixDatabase();
$this->clearProData();

if ($type == 'update') {
$this->moveLayouts();
$include = JPATH_ADMINISTRATOR . '/components/com_osdownloads/include.php';
if (is_file($include) && include $include) {
$this->checkParamStructure();
$this->checkAndCreateDefaultCategory();
$this->fixOrderingParamForMenus();
$this->fixDownloadsViewParams();
$this->fixItemViewParams();
$this->fixDatabase();
$this->clearProData();

if ($type == 'update') {
$this->moveLayouts();
}
}
}

Expand Down Expand Up @@ -170,8 +173,6 @@ protected function checkAndCreateDefaultCategory()
*/
protected function fixOrderingParamForMenus()
{
require_once JPATH_ADMINISTRATOR . '/components/com_osdownloads/include.php';

$db = $this->dbo;

$query = $db->getQuery(true)
Expand Down

0 comments on commit ba6d365

Please sign in to comment.