Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.6.0

Bug #9634 foreach error on empty array
Submitted: 2006-12-16 00:58 UTC
From: officeman at freenet dot de Assigned: ttsuruoka
Status: Closed Package: Services_Delicious (version 0.5.0)
PHP Version: Irrelevant OS: all
Roadmaps: (Not assigned)    

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 37 - 6 = ?

 [2006-12-16 00:58 UTC] officeman at freenet dot de (WarriorDeluxe)
Description: ------------ when a user has no bookmarks and you want to return the most recent bookmarks an foreach error occurs. Test script: --------------- $service = &new Services_Delicious($this->myUser, $this->myPassword); $posts = $service->getRecentPosts(); Expected result: ---------------- $posts should be filled with recent bookmark posts Actual result: -------------- an php error in Delicious.php


 [2008-03-05 17:36 UTC] amir (Amir Mohammad Saied)
I just attached a patch which will check for all arguments to see if they are really arrays then pass them to foreach. And I replaced array_push with simple $array[] = $element way, removing an unnecessary function call.
 [2008-03-06 06:48 UTC] ttsuruoka (Tatsuya Tsuruoka)
This bug has been fixed in CVS. Thank you for your patch!