Skip to content
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

Getting blank screen in 1.9.8 version #17

Closed
GaneshKandu opened this issue Aug 31, 2019 · 5 comments
Closed

Getting blank screen in 1.9.8 version #17

GaneshKandu opened this issue Aug 31, 2019 · 5 comments

Comments

@GaneshKandu
Copy link

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

@Dygear
Copy link

Dygear commented Aug 31, 2019 via email

@GaneshKandu
Copy link
Author

@Dygear Thanks for reply
worked for me
it will be good if you change requirement in Readme too

@crazy4chrissi
Copy link
Contributor

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.

@crazy4chrissi crazy4chrissi reopened this Sep 3, 2019
@crazy4chrissi
Copy link
Contributor

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 ;-)

crazy4chrissi added a commit that referenced this issue Sep 3, 2019
@crazy4chrissi
Copy link
Contributor

Should be fixed with version 1.9.8.1 released just now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants