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

Issue Type: Bug Created: 2010-02-18T00:18:09.000+0000 Last Updated: 2010-02-18T13:12:17.000+0000 Status: Resolved Fix version(s): - 1.10.2 (24/Feb/10)

Reporter: Stanislav Anisimov (satanistlav) Assignee: Thomas Weidner (thomas) Tags: - Zend_Filter

Related issues: Attachments: - PregReplace.patch


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

<pre class="highlight">
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 = '<i class="arrow-next"> </i>';



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

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.