Skip to content

Commit

Permalink
refs matomo-org#5414 this should fix the seg fault on PHP 5.3.6. I di…
Browse files Browse the repository at this point in the history
…d install an Apache + PHP 5.3.6 and was able to reproduce
  • Loading branch information
tsteur committed Aug 19, 2014
1 parent f1c0eac commit 3252814
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/Plugin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,14 @@ public function getSettingsForCurrentUser()
return $setting->isWritableByCurrentUser();
});

uasort($settings, function ($setting1, $setting2) use ($settings) {
$settings2 = $settings;

uasort($settings, function ($setting1, $setting2) use ($settings2) {

/** @var Setting $setting1 */ /** @var Setting $setting2 */
if ($setting1->getOrder() == $setting2->getOrder()) {
// preserve order for settings having same order
foreach ($settings as $setting) {
foreach ($settings2 as $setting) {
if ($setting1 === $setting) {
return -1;
}
Expand Down

0 comments on commit 3252814

Please sign in to comment.