|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-06-23 06:28 UTC] nickj-phpbugs at nickj dot org
Description:
------------
Currently ini_get("allow_url_fopen") appears to return a literal string, not a boolean value/string. For example, if the php.ini contains "allow_url_fopen = on", then ini_get("allow_url_fopen") will return "on", not "1". This is inconsistent with the documentation.
The php.ini documentation at http://au3.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen says 'allow_url_fopen' is a "boolean" configuration directive.
The ini_get() documentation at http://php.net/ini-get says:
When querying boolean values: A boolean ini value of 'off' will be returned as an empty string or "0" while a boolean ini value of 'on' will be returned as "1".
Therefore, if the php.ini contains "allow_url_fopen = on", then ini_get("allow_url_fopen") should return "1"; but it does not.
Additionally, in the php.ini itself, it lists the supported INI boolean constants as being "On, Off, True, False, Yes, No and None". It would therefore probably be good if (in addition to the 'on' and 'off' constants) the 'true', 'false', 'yes', 'no' and 'none' constants worked in the same way as well.
I have written a series of small .phpt PHP unit-tests that demonstrate the above, and I will add a URL for these in the next few minutes.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 03:00:02 2025 UTC |
Tony, what do you mean by "lot of changes in the engine and extensions"? Since allow_url_fopen and others have on_modify handler set to OnUpdateBool, everything should work, shouldn't it? It seems to me that there is simply some bug causing that boolean value isn't converted under some circumstances. BTW ini_get("allow_url_fopen") returns "1" for me (Win XP, PHP 5.0.4), but ini_set("display_errors", "On"); echo ini_get("display_errors"); displays "On".