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

Error after login when "Stay logged in on this computer" is checked #16

Open
vicentini opened this issue Feb 22, 2018 · 1 comment
Open

Comments

@vicentini
Copy link

The following error is shown on a blank page after login, when "Stay logged in on this computer" is checked on the login page.

Warning: trim() expects parameter 1 to be string, array given in /var/www/html/inc/functions.php on line 156
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/inc/functions.php:156) in /var/www/html/inc/functions.php on line 145
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/inc/functions.php:156) in /var/www/html/login.php on line 27

Even though the error shows up, the login seems to work. After a refresh of the page the user is logged in and the contacts are presented as expected.

My installation is as follows

  • contagged 0.8.0
  • php 5.6.33
  • Red Hat directory server (ldap)
  • no anonymous bind
  • public address book is only viewable by logged in users
@vicentini
Copy link
Author

I've found the reason for this issue. As it's only a small fix I won't create a pull request for it.

In file ./inc/functions.php line 156
return md5(trim(file($file)));
the file method returns an array of strings which trim can't work on.

Instead the method file_get_contents should be used which returns a string with the whole file content.
return md5(trim(file_get_contents($file)));

bob4os added a commit to bob4os/contagged that referenced this issue May 21, 2021
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

1 participant