Zend Framework

Zend_Filter_StringToLower / Upper throws exception with valid mbstring encoding

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major 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.

Activity

Hide
Thomas Weidner added a comment -

Fixed with r20912

Show
Thomas Weidner added a comment - Fixed with r20912

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: