Issues

ZF-9580: Zend_View_Helper_FormErrors does not accept string instead of array

Issue Type: Bug Created: 2010-03-31T05:10:03.000+0000 Last Updated: 2012-11-20T21:38:11.000+0000 Status: Open Fix version(s): Reporter: Erwin Derksen (erwind) Assignee: None Tags: - Zend_View

Related issues: - ZF-9753

Attachments:

Description

class: Zend_View_Helper_FormErrors method: formErrors param: $errors may be either a string or an array

The code to format the html casts to an array, but this should be done before escaping (the code directly above and probably added in a later stadium).

Comments

Posted by Christopher Manning (manningc) on 2010-09-24T13:55:40.000+0000

I am experiencing a bug related to this.

I am using $form->renderErrors() to display form errors in my view and I also added the Error decorator to the form ($form->addDecorator('Errors');)

In my case $errors = array('formfieldname'=>array('isEmpty'=>'Value is required and can't be empty'));

When Zend_View_Helper_FormErrors on L:79 it iterates through $errors to escape them, it will pass an array to $this->view->escape and not return correctly

In Zend_View_Abstract on L:897 it should exception if the $var supplied is not a string since 'htmlspecialchars', 'htmlentities' only accepts a string as their first parameter.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts