Issues

ZF-12480: PHP 5.4: Notice: Array to string conversion in Zend_Validate_Abstract

Issue Type: Patch Created: 2012-12-03T05:31:43.000+0000 Last Updated: 2012-12-03T09:26:56.000+0000 Status: Closed Fix version(s): Reporter: Adrien Crivelli (powerkiki) Assignee: Frank Br├╝ckner (frosch) Tags: - Zend_Validate

Related issues: - ZF-12194

Attachments:

Description

Zend_Validate_Abstract converts array to string and thus raise notices with PHP 5.4

How to reproduce:

<pre class="highlight">
<?php 

require('Zend/Validate.php');
require('Zend/Validate/NotEmpty.php');

$validator = new Zend_Validate_NotEmpty();
$validator->isValid(array()); // Will raise a PHP 5.4 notice

According to what was done for http://framework.zend.com/issues/browse/ZF-11906 (specifically in r24807), I suggest the modification of library/Zend/Validate/Abstract.php at line 233 as follow:

Before:

<pre class="highlight">
        } else {
            $value = (string)$value;
        }

After:

<pre class="highlight">
        } else {
            $value = implode(' ', (array)$value);
        }

Comments

No comments to display

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