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

Description

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)

Comments

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.