textpattern/textpattern — pull request #441 by petecooper (2014-10-07 09:27:32+00:00)
Title: Fix `ip` size for new instances and 4.6 upgrades

Addresses https://github.com/textpattern/textpattern/issues/438

`ip` doesn’t need to be longer than 45 characters long. An IPv6 address with IPv4 tunnelling is the longest format at 45 characters. Brace yourself:

(6 * 4 + 5) + 1 + (4 * 3 + 3) = 29 + 1 + 15 = 45

With that in mind, three changes:

* Change `ip` in `txp_discuss` from 100 to 45
* Change `ip` in `txp_discuss_ipban` from 255 to 45
* Change `ip` in `txp_log` from 16 to 45

The change to `txp_log` does concern me a little. According to the 4.5.7 release notes, there is support for IPv6 in the logs, but `textpattern/setup/txpsql.php` only sets `ip` up for `varchar(16)`, which isn’t big enough for a full-fat IPv6 address. I’ll raise an issue.