Skip to content

Commit

Permalink
FIX | add some array checks to prevent exceptions. One on first insta…
Browse files Browse the repository at this point in the history
…ll, second on opening module if an identifier is wrong.
  • Loading branch information
Ralf Merz committed May 8, 2018
1 parent 343e84e commit c36f58a
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 c36f58a

Please sign in to comment.