4images Forum & Community

4images Help / Hilfe => Bug Fixes & Patches => Topic started by: V@no on August 25, 2010, 04:45:35 AM

Title: [1.7.1 - 1.7.8] Can't login
Post by: V@no on August 25, 2010, 04:45:35 AM
On some servers this "bug" won't let login into 4images unless selected "Log me on automatically next visit" checkbox at members login form. It only affects some servers that for some reason return text value of boolean settings in php.ini Technically this is not 4images fault, because according PHP documentation register_globals (http://www.php.net/manual/en/ini.core.php#ini.register-globals) is a boolean value, and in documentation for ini_get() (http://php.net/manual/en/function.ini-get.php) states:
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.



The fix is simple:
in includes/sessions.php find:
    if (@ini_get('register_globals')) {

Replace with:
    $register_globals = strtolower(@ini_get('register_globals'));
    if ($register_globals && $register_globals != "off" && $register_globals != "false") {