Index: library/Zend/Text/MultiByte.php =================================================================== --- ../library/Zend/Text/MultiByte.php (revision 24746) +++ ../library/Zend/Text/MultiByte.php (working copy) @@ -107,7 +107,7 @@ $lengthOfPadding = $padLength - iconv_strlen($input, $charset); $padStringLength = iconv_strlen($padString, $charset); - if ($padStringLength === 0 || $lengthOfPadding === 0) { + if ($padStringLength === 0 || $lengthOfPadding <= 0) { $return = $input; } else { $repeatCount = floor($lengthOfPadding / $padStringLength); Index: tests/Zend/Text/MultiByteTest.php =================================================================== --- ../tests/Zend/Text/MultiByteTest.php (revision 24746) +++ ../tests/Zend/Text/MultiByteTest.php (working copy) @@ -263,6 +263,24 @@ $text = Zend_Text_MultiByte::strPad('äääöö', 5, 'ö', STR_PAD_RIGHT); $this->assertEquals('äääöö', $text); } + + public function testPadInputLongerThanPadLength() + { + $text = Zend_Text_MultiByte::strPad('äääöö', 2, 'ö'); + $this->assertEquals('äääöö', $text); + } + + public function testPadInputSameAsPadLength() + { + $text = Zend_Text_MultiByte::strPad('äääöö', 5, 'ö'); + $this->assertEquals('äääöö', $text); + } + + public function testPadNegativePadLength() + { + $text = Zend_Text_MultiByte::strPad('äääöö', -2, 'ö'); + $this->assertEquals('äääöö', $text); + } } // Call Zend_Text_MultiByteTest::main() if this source file is executed directly.