Issues

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

Description

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

How to reproduce:


<?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:


        } else {
            $value = (string)$value;
        }

After:


        } else {
            $value = implode(' ', (array)$value);
        }

Comments

No comments to display