ZF-2522: Zend_Filter_Inflector __construct params ignored

Description

@version $Id: Inflector.php 7078 2007-12-11 14:29:33Z matthew $

Parameters $throwTargetExceptionsOn and $targetReplacementIdentifer in Zend_Filter_Inflector __construct method are ignored if boolean false.

Actual code:


    if ($throwTargetExceptionsOn != null) {
        $this->setThrowTargetExceptionsOn($throwTargetExceptionsOn);
    }

    if ($targetReplacementIdentifer != null) {
        $this->setTargetReplacementIdentifier($targetReplacementIdentifer);
    }

Proposed fix:


    if ($throwTargetExceptionsOn !== null) {
        $this->setThrowTargetExceptionsOn($throwTargetExceptionsOn);
    }

    if ($targetReplacementIdentifer !== null) {
        $this->setTargetReplacementIdentifier($targetReplacementIdentifer);
    }

Comments

Fixed in r8226.

The targetReplacementIdentifier actually should be checking that the string is not != ''. The exception flag was fixed as well.

-ralph