ZF-9058: Zend_Filter_StringToLower / Upper throws exception with valid mbstring encoding

Issue Type: Bug Created: 2010-02-02T05:41:56.000+0000 Last Updated: 2010-02-04T11:46:05.000+0000 Status: Resolved Fix version(s): - 1.10.1 (10/Feb/10)

Reporter: Lucas Corbeaux ( Assignee: Thomas Weidner (thomas) Tags: - Zend_Filter

Related issues: Attachments:


Since the 1.10.0, both filters Zend_Filter_StringToUpper and Zend_filter_StringToLower check the $encoding param :

<pre class="highlight">
if (!in_array($encoding, mb_list_encodings())) {
   require_once 'Zend/Filter/Exception.php';
   throw new Zend_Filter_Exception("The given encoding '$encoding' is not supported by mbstring");

The problem is this test is case sensitive, but mbstring functions aren't. Following code works well in 1.9.7 but 1.10.0 break it :

<pre class="highlight">
$filter = new Zend_Filter_StringToUpper();
$filter->setEncoding('utf-8'); // => Exception thrown in 1.10.0 : "The given encoding 'utf-8' is not supported by mbstring"
echo $filter->filter('test'); // => Works well in 1.9.7 : no warning from mb_strtoupper function

I think this behavior is not desired.


Posted by Thomas Weidner (thomas) on 2010-02-04T11:46:05.000+0000

Fixed with r20912

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.