Gentlemen and ladies, colleagues, help me figure it out. We have in the form of the following element:

$token = new Zend_Form_Element_Hash('csrf_token'); $token->setSalt(md5(microtime() . uniqid())); 

How do I change the error messages, he displays "The two given tokens do not match". I already climbed the Zend classes themselves, or found anything. In fact, this normal validator works, but how can I change this error message to my own?

    1 answer 1

    Understood, you just had to do:

     $token = new Zend_Form_Element_Hash('csrf_token'); $token->setSalt(md5(microtime() . uniqid())); $token->getValidator('Identical')->setMessages(array( Zend_Validate_Identical::MISSING_TOKEN => 'Обнаружена попытка CSRF-атаки. Перезагрузите форму.', Zend_Validate_Identical::NOT_SAME => 'Обнаружена попытка CSRF-атаки. Перезагрузите форму.' ));