WillyXJ / facileManager

A modular suite of web apps built with the sysadmin in mind.
www.facilemanager.com
GNU General Public License v2.0
84 stars 37 forks source link

[BUG] Adding DNS records via api is broken on PHP8.1 #600

Closed ValeriiVozniuk closed 4 months ago

ValeriiVozniuk commented 5 months ago

fM Version : 4.5.0 fmDNS Version : 5.3.3


(BUG | ISSUE) Expected Behavior: I'm able to create a DNS record via api call

(BUG | ISSUE) Actual Behavior: Script silently finishes

(BUG | ISSUE) Steps to reproduce: Try to add a DNS record via console, for example php /usr/local/facileManager/fmDNS/client.php setHost id=10 action=add type=A name=www value=172.10.33.1 status=active

The issue is in https://github.com/WillyXJ/facileManager/blob/master/client/facileManager/fmDNS/client.php#L82, function call_user_func_array https://www.php.net/manual/en/function.call-user-func-array.php

8.0.0 | args keys will now be interpreted as parameter names, instead of being silently ignored.

changing the line to call_user_func_array('array_merge', array_values($api_params)) seems fixes the issue, but I'm not sure if this is matches the code intentions/correct way to fix it.

PS: there is another call to this function in https://github.com/WillyXJ/facileManager/blob/master/server/fm-modules/facileManager/classes/class.phpmailer.php#L2934, and it may need to be fixed too.

WillyXJ commented 4 months ago

This is now fixed in fmDNS 6.0.0 and later.