ZF-2964: Zend_Filter_Inflector cause PHP-error when "nothing to do"

Issue Type: Bug Created: 2008-03-25T10:17:02.000+0000 Last Updated: 2008-07-25T14:02:29.000+0000 Status: Resolved Fix version(s): - 1.5.3 (28/Jul/08)

Reporter: Sebastian Krebs (kingcrunch) Assignee: Ralph Schindler (ralph) Tags: - Zend_Filter_Inflector

Related issues: Attachments:



<pre class="highlight">$bla = new Zend_Filter_Inflector('abc');
echo $bla->filter (array('xy'=>'ab'));

This causes a php-error

<pre class="highlight">Notice: /Zend/Zend/Filter/Inflector.php line 451 - Undefined variable: processedParts
Debug Warning: /Zend/Zend/Filter/Inflector.php line 451 - array_keys() [<a href="function.array-keys">function.array-keys</a>]: The first argument should be an array
Notice: /Zend/Zend/Filter/Inflector.php line 451 - Undefined variable: processedParts
Debug Warning: /Zend/Zend/Filter/Inflector.php line 451 - array_values() [<a href="function.array-values">function.array-values</a>]: The argument should be an array
Debug Warning: /Zend/Zend/Filter/Inflector.php line 451 - preg_replace() [<a href="function.preg-replace">function.preg-replace</a>]: Empty regular expression

and the return value is null. I my mind it should be abc or at least an empty string.

I had a look at line 451

<pre class="highlight">
and when I debug it, it seems to me, that the array _processedParts_ doesnt exists, if there are no replacements to do (see first notice "undefined variable"). In the example above there is a rule and there is something in _filter()_, but they dont match. The most simple example is this

$bla = new Zend_Filter_Inflector(''); var_dump($bla->filter (array()));```

The array is never initialized. The file revision is 8226 (trunk).


Posted by Ralph Schindler (ralph) on 2008-03-25T10:58:03.000+0000

Fixed in trunk in r9045.

Lemme know if that fixes it..


Posted by Ralph Schindler (ralph) on 2008-07-25T14:02:29.000+0000

Fixed in 1.5.3 with r10431

Have you found an issue?

See the Overview section for more details.


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

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