File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -3860,7 +3860,12 @@ PHP_FUNCTION(array_multisort)
3860
3860
* accordingly. There can't be two sort flags of the same type after an
3861
3861
* array, and the very first argument has to be an array. */
3862
3862
for (i = 0 ; i < argc ; i ++ ) {
3863
- if (Z_TYPE (args [i ]) == IS_ARRAY ) {
3863
+ zval * arg = & args [i ];
3864
+
3865
+ if (Z_TYPE_P (arg ) == IS_REFERENCE ) {
3866
+ arg = Z_REFVAL_P (arg );
3867
+ }
3868
+ if (Z_TYPE_P (arg ) == IS_ARRAY ) {
3864
3869
/* We see the next array, so we update the sort flags of
3865
3870
* the previous array and reset the sort flags. */
3866
3871
if (i > 0 ) {
@@ -3869,14 +3874,14 @@ PHP_FUNCTION(array_multisort)
3869
3874
sort_order = PHP_SORT_ASC ;
3870
3875
sort_type = PHP_SORT_REGULAR ;
3871
3876
}
3872
- arrays [num_arrays ++ ] = & args [ i ] ;
3877
+ arrays [num_arrays ++ ] = arg ;
3873
3878
3874
3879
/* Next one may be an array or a list of sort flags. */
3875
3880
for (k = 0 ; k < MULTISORT_LAST ; k ++ ) {
3876
3881
parse_state [k ] = 1 ;
3877
3882
}
3878
- } else if (Z_TYPE ( args [ i ] ) == IS_LONG ) {
3879
- switch (Z_LVAL ( args [ i ] ) & ~PHP_SORT_FLAG_CASE ) {
3883
+ } else if (Z_TYPE_P ( arg ) == IS_LONG ) {
3884
+ switch (Z_LVAL_P ( arg ) & ~PHP_SORT_FLAG_CASE ) {
3880
3885
case PHP_SORT_ASC :
3881
3886
case PHP_SORT_DESC :
3882
3887
/* flag allowed here */
You can’t perform that action at this time.
0 commit comments