Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.10.4
-
Fix Version/s: 1.10.7
-
Component/s: Zend_Feed_Pubsubhubbub
-
Labels:None
Description
Under Zend/Feed/Pubsubhubbub/Model/Subscription.php one finds the function setSubscription($data) with code (line 54):
$result = $this->_db->find($data['id']);
if ($result) { ... }
At least in my application, where _db is a Mysqli interface, $result is always evaluated to true even if no rows are found.
Shouldn't the test be done instead with count()?
$result = $this->_db->find($data['id']);
if (count($result)>0) { ... }
This problem occur in all method of Zend_Feed_Pubsubhubbub_Model_Subscription.
Because Zend_Db_Table:>find() returns Zend_Db_Table_Rowset.
In This case the condition always is true. Sample code.