Sterc / FormIt

A dynamic form processing Snippet for MODX Revolution
https://docs.modx.com/current/en/extras/formit
33 stars 58 forks source link

FormItSaveForm not working on IPv6 #135

Closed tsndr closed 6 years ago

tsndr commented 7 years ago

Error-Log:

[2017-08-26 17:14:46] (ERROR @ /var/www/tobias-schneider/main/core/xpdo/om/xpdoobject.class.php : 1452) Error 22001 executing statement:
INSERT INTO `modx_formit_forms` (`form`, `context_key`, `values`, `ip`, `date`, `encrypted`, `encryption_type`, `hash`) VALUES ('anfrage', 'web', '{\"nospam\":\"\",\"anrede\":\"Herr\",\"vorname\":\"Max\",\"nachname\":\"Mustermann\",\"email\":\"max@mustermann.de\",\"telefon\":\"0123456789\",\"nachricht\":\"Hallo das ist ein Test! Test\"}', '2a02:8106:21d:4000:6de4:ccee:af1b:1ba0', 1503760486, 0, 1, 'c56cb37bb69739b5bfe6d38ce64dfe32')
Array
(
    [0] => 22001
    [1] => 1406
    [2] => Data too long for column 'ip' at row 1
)

[2017-08-26 17:14:46] (ERROR @ /var/www/tobias-schneider/main/core/cache/includes/elements/modsnippet/11.include.cache.php : 160) [FormItSaveForm] An error occurred while trying to save the submitted form: Array
(
    [id] => 
    [form] => anfrage
    [context_key] => web
    [values] => {"nospam":"","anrede":"Herr","vorname":"Max","nachname":"Mustermann","email":"max@mustermann.de","telefon":"0123456789","nachricht":"Hallo das ist ein Test! Test"}
    [ip] => 2a02:8106:21d:4000:6de4:ccee:af1b:1ba0
    [date] => 1503760486
    [encrypted] => 
    [encryption_type] => 1
    [hash] => c56cb37bb69739b5bfe6d38ce64dfe32
)
joeke commented 7 years ago

@tsndr You're right. The IP field is limited to 15 characters. I've increased the length to 100 characters to allow for IPV6 addresses as wel. Will be included in the 3.0.3 release.