Pages (2):    1 2
Member
Member
sbillard   2011-08-03, 17:51
#21

Sure, we could do this for each and every ini_get() we use. But then what is the point of ini_get()? Seriously, the solution for this problem is as posted. Be sure the PHP.ini file has set the option to the proper constant. (Note also that the other thread you reference is really not the same. In that case the problem was caused by incorrect case in the "constant" so the feature was indeed on as reported.)

Bottom line is that Zenphoto will report the settign of the ini_get(). If in some cases that does not match the actual enable of the feature at least we know we will error on the conservative side. There is really no justification for using a sledge hammer to kill this fly.

Member
Member
infisxc   2011-08-04, 07:14
#22

Quote:But then what is the point of ini_get()?
In fact, the more I think about it, the less I believe that you correctly use ini_get. I just read again the documentation. It is explicitely written

Quote:Note: 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". The function can also return the literal string of INI value.
I understand it as "a ini value of off will usually be returned as an empty string or '0', but might also be returned as the string 'off'." So you cannot just convert it to a boolean but you have to test the string, as suggested in the comments by "nicolas dot grekas+php at gmail dot com". Please note that there is also another remark by "filh at filh dot org" that says pretty much the same:
Quote:Important: The manual says that ini_get will return 0 [...]. This is technically correct, however when you use [...] in an .htaccess file, ini_get will return the string, which will "evaluate" to 1.
Please also note that all the comments about boolean values in the manual page of ini_get are about register_globals. This problem is usual and well reported. The way you handle it (as correct as it can be from a purist point of view) is not the recommended way.

Quote:(Note also that the other thread you reference is really not the same. In that case the problem was caused by incorrect case in the "constant" so the feature was indeed on as reported.)
I am really not sure. When testing the string returned by ini_get, they all apply strtolower first which suggests that the keywords are case insensitive. In my opinion, the problem reported by 100cccer is exactly the same problem: the keyword used was Off, which indeed deactivated register_globals but was returned as "Off" by ini_get. It has been changed into off, so that ini_get now returns an empty string. But most likely, register_globals was in fact deactivated from the very beginning.

Member
Member
infisxc   2011-08-04, 08:21
#23

In the PHP package distributed with my Debian distribution, the default settings in php.ini are given with keywords beginning with an upper-case (e.g., Off, and not off). It seems fairly clear to me that the keywords are case insensitive and the problem reported in the other thread by 100cccer was not a problem of case.

Pages (2):    1 2
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.