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

Unable to login when using IPv6. #2721

Closed
burtyb opened this issue Nov 22, 2023 · 1 comment
Closed

Unable to login when using IPv6. #2721

burtyb opened this issue Nov 22, 2023 · 1 comment
Assignees
Labels
Milestone

Comments

@burtyb
Copy link
Sponsor

burtyb commented Nov 22, 2023

Describe the bug
Trying to login from an IPv6 address results in the error.

phpMyFAQ Fatal error
Uncaught exception: 'mysqli_sql_exception'

Message: 'Data too long for column 'ip' at row 1'

Stack trace:

#0 .../public_html/src/phpMyFAQ/Database/Mysqli.php(308): mysqli->query()
#1 .../public_html/src/phpMyFAQ/User/CurrentUser.php(386): phpMyFAQ\Database\Mysqli->query()
#2 .../public_html/src/phpMyFAQ/User/CurrentUser.php(191): phpMyFAQ\User\CurrentUser->updateSessionId()
#3 .../public_html/src/phpMyFAQ/User/UserAuthentication.php(69): phpMyFAQ\User\CurrentUser->login()
#4 .../public_html/index.php(176): phpMyFAQ\User\UserAuthentication->authenticate()
#5 {main}
Thrown in '.../public_html/src/phpMyFAQ/Database/Mysqli.php' on line 308

To Reproduce
Steps to reproduce the behavior:

  1. Install on a server with an IPv6 address.
  2. Try to login from an IPv6 address (longer than 15 chars).
  3. See error

Expected behavior

Login should succeed (temporarily changing faquser.ip to VARCHAR(39) allows the login).

phpMyFAQ:

  • phpMyFAQ version 3.2.2
  • PHP version 8.2.11
  • Database Mysql
  • Elasticsearch no

Desktop:

  • OS: Windows 10
  • Browser Chrome
  • Version 119.0.6045.160 (Official Build) (64-bit)
@thorsten thorsten self-assigned this Nov 22, 2023
@thorsten thorsten added the Bug label Nov 22, 2023
@thorsten thorsten added this to the 3.2.3 milestone Nov 22, 2023
@thorsten
Copy link
Owner

Here's the quick fix if you have the possibility to use phpMyAdmin:

ALTER TABLE faquser CHANGE ip ip VARCHAR(64) NULL DEFAULT NULL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants