ZF2-585: Filtering value more than one time

Issue Type: Bug Created: 2012-09-25T12:11:39.000+0000 Last Updated: 2012-10-08T20:11:02.000+0000 Status: Closed Fix version(s): Reporter: Gandzy Ghennady (ghennady) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend\Filter

  • Zend\InputFilter

Related issues: Attachments:


<pre class="highlight">

     * @return mixed
    public function getValue()
        $filter = $this->getFilterChain();
        return $filter->filter($this->value);

In case filter have filters Zend\Filter\File\Rename, Zend\Filter\File\LowerCase, Zend\Filter\File\UpperCase, each call getValue() call filters, and we have result is different from the expected. Following example

<pre class="highlight">
   $source = __DIR__ . '/_files/toRename.txt';
   $testSource = __DIR__ . '/_files/_toRename.txt';
   if (!file_exists($testSource))
      copy($source, $testSource);

   $target = __DIR__ . '/_files/renamed.txt';

   $input = new Input('foo');


   $filter = new Filter\File\Rename(
      array('target' => $target, 'overwrite' => true)

   $this->assertEquals($target, $input->getValue()); //Pass
   $this->assertEquals($target, $input->getValue()); //Fail

<pre class="highlight">
   if ($input->isValid()) //call $input->GetValue()
     $value = $input->getValue() // result is different from the expected


Posted by Ralph Schindler (ralph) on 2012-10-08T20:11:02.000+0000

This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit:

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.