slawkens / myaac

A free and open-source Automatic Account Creator (AAC) written in PHP
https://my-aac.org
GNU General Public License v3.0
125 stars 99 forks source link

IPv6 issue when env is set to dev #171

Closed Dzanar closed 2 years ago

Dzanar commented 3 years ago

Server configuration

Client configuration (Your Computer)

Description: When the "$config['env'] = 'dev';" in the config.local.php and you have a IPv6 the page not loading.

Steps To Reproduce:

  1. Set $config['env'] = 'dev' in config.local.php.
  2. When you using IPv6 the page was not load and throw exception

`Whoops something went wrong... SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'ip' at row 1

Backtrace:

0 /home/otsmanager/www/nelena/system/libs/visitors.php(97): PDO->exec()

1 /home/otsmanager/www/nelena/system/libs/visitors.php(40): Visitors->addVisitor()

2 /home/otsmanager/www/nelena/index.php(240): Visitors->__construct()

3 {main}`

slawkens commented 2 years ago

Thanks for reporting this.

The solution is to resize the ip field in visitors table.

The query:

ALTER TABLE `myaac_visitors` MODIFY `ip` VARCHAR(45) NOT NULL;