FOGProject / fogproject

An open source computer cloning & management system
https://fogproject.org
GNU General Public License v3.0
1.1k stars 221 forks source link

Use array_values() in call_user_func_array to comply with PHP 8 #490

Closed abulhol closed 2 years ago

abulhol commented 2 years ago

The API router doesn't work anymore on PHP 8 [1] because call_user_func_array uses the array keys as parameter names [2].

The recommended fix is to wrap the parameter array into array_values(). This is what I did here.

[1] https://forums.fogproject.org/topic/16370/api-doesn-t-work-in-1-5-9-dev-error-in-route-class-php [2] https://php.watch/versions/8.0/named-parameters#named-params-call_user_func_array