mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fix ArrayList sort error with old (supported) PHP
PHP 5.3 at least (the reported and tested against version) requires arguments to `call_user_func_array` to be passed by reference. There exists a note as a comment in the code, but was unfortunately overlooked in a previous commit to fix case sensitive sorting 4998b80445 (diff-6ba746c3d31fd6b4c4a99d7efe35eb21L442)
To solve this issue we simply first assign the constant to a variable, so we can then pass that by reference. This has no functional impact, however fixes an issue for users locked in to old PHP versions which we still list as supported (https://docs.silverstripe.org/en/3/getting_started/server_requirements/#web-server-software-requirements).
This commit is contained in:
parent
1f256cf2d2
commit
ebe1de8d8b
@ -448,7 +448,8 @@ class ArrayList extends ViewableData implements SS_List, SS_Filterable, SS_Sorta
|
|||||||
// First argument is the direction to be sorted,
|
// First argument is the direction to be sorted,
|
||||||
$multisortArgs[] = &$sortDirection[$column];
|
$multisortArgs[] = &$sortDirection[$column];
|
||||||
if ($firstRun) {
|
if ($firstRun) {
|
||||||
$multisortArgs[] = SORT_REGULAR;
|
$sortArg = SORT_REGULAR;
|
||||||
|
$multisortArgs[] = &$sortArg;
|
||||||
}
|
}
|
||||||
$firstRun = false;
|
$firstRun = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user