Issues

ZF-12186: Zend_Text_MultiByte::strPad() Warning on Input Longer Than Pad Length

Issue Type: Bug Created: 2012-05-04T21:29:31.000+0000 Last Updated: 2012-05-06T00:11:22.000+0000 Status: Resolved Fix version(s): - 1.11.12 (22/Jun/12)

  • 1.12.0 (27/Aug/12)

Reporter: Robert Purcell (robertology) Assignee: Robert Purcell (robertology) Tags: - Zend_Text_Table

  • FixForZF1.12

Related issues: Attachments: - multibytePatch.txt

Description

Zend_Text_MultiByte::strPad() gives a warning when pad_length is negative or less than input string. Results in a warning "str_repeat(): Second argument has to be greater than or equal to 0" and returns the input string.

Return value is as expected but should not give a warning.

From str_pad() doc page: "If the value of pad_length is negative, less than, or equal to the length of the input string, no padding takes place."

Comments

Posted by Robert Purcell (robertology) on 2012-05-04T21:33:05.000+0000

Patch with unit test

Posted by Adam Lundrigan (adamlundrigan) on 2012-05-06T00:11:22.000+0000

Fixed in trunk (1.12.0): r24762 Fixed in release-1.11 (1.11.12): r24763

Have you found an issue?

See the Overview section for more details.

Copyright

© 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.

Contacts