Issues

ZF-9202: "does not have a valid MatchPattern set." error in Zend_Filter_PregReplace

Description

Extending Zend_Filter_PregReplace like the following code will throw fatal error "does not have a valid MatchPattern set". Passing null as options to the constrcutor should not set matchPattern property to NULL, while this property is set in the child class


require_once 'Zend/Filter/PregReplace.php';

class Ms_View_Filter_LinkArrows extends Zend_Filter_PregReplace{
     
    /**
     * Pattern to match
     * @var mixed
     */
    protected $_matchPattern = array('~(>){3,}~i');

    /**
     * Replacement pattern
     * @var mixed
     */
    protected $_replacement = ' ';

}

Comments

Attached the patch, after I will attach the file with unit tests.

This problem may also occur in: Zend_Filter_StringTrim Zend_Filter_StripTags

I will also review the Validators.

Attached file with test unit.

Fixed with r21086