-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix GH-19018: php_admin_value disable_functions ignored #20637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: PHP-8.3
Are you sure you want to change the base?
Conversation
This happens because disable_functions are not explicitly disabled. The fix explicitly calls zend_disable_functions when config is applied.
|
This looks a bit ugly. Why is this not done in the ini message handler instead? |
|
What do you mean? This is normally explicitly called in main after all functions are loaded in https://github.com/php/php-src/blob/php-8.3.28/main/main.c#L2266 . The problem with php_admin_value (here and in FPM) is that they are loaded after this so zend_disable_functions needs to be called explicitly. We can consider some refactoring for master but I think it should mirror FPM for bug fix. |
|
Create a custom INI_MH function for disable_functions. Either move the call to
This looks equally ugly.
We are on master. |
But it's not really supposed to be called the first time (it won't do much harm but it will need to be called again when all extensions are loaded). What is in FPM and here is just non standard thing that is mostly not being used so a new INI_MH would be used really just for this edge case.
Sorry forgot to set base somehow. This is a bug fix targetting 8.3. |
Just to clarify I mean it's not supposed to be called in php.ini loading because not all functions will be load at that time so there would need to be logic to skip it at that point but just allow to set it later. I guess it can be done but seems more like refactoring as it would also require FPM changes so that should happen just in master IMO. |
|
Okay |
This happens because disable_functions are not explicitly disabled. The fix explicitly calls zend_disable_functions when config is applied.
The WST test for this available here: https://github.com/wstool/wst-php-apache2handler/blob/6573dd55449504e71971c939bf1cca79412197b3/spec/instances/php-admin-value-disable-functions.yaml