Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.10.0
-
Fix Version/s: 1.10.1
-
Component/s: Zend_Filter
-
Labels:None
Description
Since the 1.10.0, both filters Zend_Filter_StringToUpper and Zend_filter_StringToLower check the $encoding param :
Zend_Filter_StringToUpper / Lower::setEncoding(), line 91 to 94
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 :
$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.
Fixed with r20912