Closed GaneshKandu closed 5 years ago
You need at least version PHP 5.6.0 to use that function.
— Thank you for your time, Mark “Dygear” Tomlin.
On Aug 31, 2019, at 05:43, Ganesh Kandu notifications@github.com wrote:
Hi,
i am getting blank screen in 1.9.8 version of phpLiteAdmin with this error
PHP Fatal error: Call to undefined function hash_equals() in phpliteadmin.php on line 4350 system details
server apache 2 php 5.3 phpLiteAdmin requirements https://github.com/phpLiteAdmin/pla#requirements
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
@Dygear Thanks for reply
worked for me
it will be good if you change requirement in Readme
too
Wait. We have this code there for old PHP versions:
// for php < 5.6.0
if(!function_exists('hash_equals'))
{
function hash_equals($str1, $str2)
{
if(strlen($str1) != strlen($str2))
return false;
else {
$res = $str1 ^ $str2;
$ret = 0;
for($i = strlen($res) - 1; $i >= 0; $i--)
$ret |= ord($res[$i]);
return !$ret;
}
}
}
Normally, this should ensure compatibility with older PHP versions. Either we should make that code work or drop it and raise the required PHP version. I will first check why it does not work.
The reason is, as I guessed, the order: The workaround function is placed in lines 4194-4208. It is used in lines 4243, 4245, 4251 and 4350. These calls are in the Authorization constructor, which is called in line 760. Therefore, at this point in time, the workaround code has not been called and the function is still undefined.
We would need to move the workaround code above line 760...
It seems PHP 5.3 is still used quite a lot: https://w3techs.com/technologies/details/pl-php/5/all So I guess I will fix this and release an 1.9.8.1 ;-)
Should be fixed with version 1.9.8.1 released just now.
Hi,
i am getting blank screen in 1.9.8 version of phpLiteAdmin with this error
system details
phpLiteAdmin requirements https://github.com/phpLiteAdmin/pla#requirements