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
Posted by Ramon Henrique Ornelas (ramon) on 2010-02-18T02:21:12.000+0000
Attached the patch, after I will attach the file with unit tests.
Posted by Ramon Henrique Ornelas (ramon) on 2010-02-18T03:02:31.000+0000
This problem may also occur in: Zend_Filter_StringTrim Zend_Filter_StripTags
I will also review the Validators.
Posted by Ramon Henrique Ornelas (ramon) on 2010-02-18T11:24:32.000+0000
Attached file with test unit.
Posted by Thomas Weidner (thomas) on 2010-02-18T13:12:17.000+0000
Fixed with r21086