Skip to content

Commit

Permalink
refs #5414 this should fix the seg fault on PHP 5.3.6. I did install …
Browse files Browse the repository at this point in the history
…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
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

1 comment on commit 3252814

@CantonDesignStudios
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If trying this fix, notice that on line 130 that use ($settings2) changed as well, it was not just that the line moved down. I tried at first without noticing this and failed miserably.

Please sign in to comment.