ZF2-253: \Zend\Filter\StringTrim return NULL at Russian "Р" ("Рп", "Рз" ...)

Issue Type: Bug Created: 2012-04-03T20:20:03.000+0000 Last Updated: 2012-06-06T10:26:31.000+0000 Status: Resolved Fix version(s): Reporter: Vitalii (duken) (duken) Assignee: Maks 3w (maks3w) Tags: - Zend\Filter

  • filter

Related issues: - ZF2-170



If string begin at Russian "Р" ("Рп", "Рз" ...)and another character it return null.

$filter = new \Zend\Filter\StringTrim(); require_once 'Zend/Filter/StringTrim.php'; $filter2 = new \Zend_Filter_StringTrim(); $value = 'Расчет '; var_dump($filter->filter($value)); var_dump($filter2->filter($value));

Result: null string 'Расчет' (length=12)

Expected result: string 'Расчет' (length=12) string 'Расчет' (length=12)


Posted by Vitalii (duken) (duken) on 2012-04-04T10:37:22.000+0000

Difference at version is preg_replace pattern: At zf1: $pattern = "/^[\s]|[\s]$/sSD"; At zf2: $pattern = "/^[\s]|[\s]$/usSD"; difference is in adding 'u' modifier.

Posted by Maks 3w (maks3w) on 2012-06-06T10:26:31.000+0000

Fixed with

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.