Skip to content

Commit

Permalink
Merge pull request #1 from merzilla/feature/fix-first-install
Browse files Browse the repository at this point in the history
FIX | add some array checks to prevent exceptions.
  • Loading branch information
merzilla authored May 8, 2018
2 parents 343e84e + c36f58a commit b2a9afb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 4 additions & 2 deletions Classes/Controller/IconcheckController.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ public function indexAction()
$iconsToShow[$string][] = $key;
}
}
// Sort icons
natcasesort($iconsToShow[$string]);
// Sort icons (only if it is an array)
if (is_array($iconsToShow[$string])) {
natcasesort($iconsToShow[$string]);
}
}
$this->view->assign('iconsToShow', $iconsToShow);
}
Expand Down
14 changes: 9 additions & 5 deletions Classes/Domain/Model/Dto/ExtensionConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ class ExtensionConfiguration

public function __construct()
{
/** @noinspection UnserializeExploitsInspection */
$settings = (array)unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['iconcheck']);
foreach ($settings as $key => $value) {
if (property_exists(__CLASS__, $key)) {
$this->$key = $value;
if ($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['iconcheck'] === null) {
$settings = [];
} else {
/** @noinspection UnserializeExploitsInspection */
$settings = (array)unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['iconcheck']);
foreach ($settings as $key => $value) {
if (property_exists(__CLASS__, $key)) {
$this->$key = $value;
}
}
}
}
Expand Down

0 comments on commit b2a9afb

Please sign in to comment.