Issues

ZF-7100: Zend_Paginator can raise a divide by 0 warning

Issue Type: Bug Created: 2009-06-23T08:42:16.000+0000 Last Updated: 2009-07-07T10:05:34.000+0000 Status: Resolved Fix version(s): Reporter: Ryan Mauger (bittarman) Assignee: Jurrien Stutterheim (norm2782) Tags: - Zend_Paginator

Related issues: Attachments:

Description

If itemCountPerPage is set to 0 or setItemCountPerPage is not called, a divide by 0 warning may be raised.

This could be avoided by either setting some default item count per page, or throwing an exception if the _calculatePageCount method is called without first setting a valid itemCountPerPage.

Throwing an exception should be prefered, as userland code could set the value to 0 if there is incorrect filtering. Relying on a php warning should not be correct however.

Comments

Posted by Frank Groeneveld (frenkel) on 2009-07-02T10:26:07.000+0000

This problem can be resolved by not using _itemCountPerPage in the Paginator, but calling getItemCountPerPage (which will return the default value if none is set).

Posted by Ryan Mauger (bittarman) on 2009-07-07T10:05:34.000+0000

This has been duplicated by ZF-7207 (http://tinyurl.com/lqyqym) and has now been resolved.

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