ZF2-43: Zend\Translator tests fail because of unescaped regex

Issue Type: Bug Created: 2011-07-28T07:16:04.000+0000 Last Updated: 2012-07-09T15:31:33.000+0000 Status: Resolved Fix version(s): Reporter: Shahar Evron (shahar) Assignee: Thomas Weidner (thomas) Tags: - Zend\I18n

  • zf-crteam-padraic
  • zf-crteam-priority

Related issues: Attachments: - ZF2-45-naive-fix.patch


This looks like a regression that was introduced in commit 8e34a0ea0f33ca, now in master branch.

It seems that the pattern used to create the RegexIterator is not being escaped properly, so for example if $ignore is '/.' (which is probably the most common value), the regex will be '//./u' which is invalid.

This breaks the tests, and I get for example:

<pre class="highlight">
37) ZendTest\Translator\TranslatorTest::testSettingLogPriorityForLog
InvalidArgumentException: RecursiveRegexIterator::__construct(): Unknown modifier '.'



Posted by Shahar Evron (shahar) on 2011-07-28T07:35:39.000+0000

This is a naive attempt to fix the problem that works for me. Hopefully it is good enough.

Posted by Thomas Weidner (thomas) on 2011-07-30T12:06:50.000+0000

This patch breaks 36 tests in my environment. It seems to be a Win_-_nix problem.

Posted by Thomas Weidner (thomas) on 2011-08-30T19:26:52.000+0000

Fixed with GH-358

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.