PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Networking » Net_SMS » Bug #6578

Error in error handling

Details

Submitted2006-01-25 13:38 UTC
Fromjmourot at sdis69 dot fr
Assignedyunosh
StatusClosed
PackageNet_SMS
PHP Version4.3.10
OSWin32
Roadmaps(Not assigned)

Comments

[2006-01-25 13:38 UTC] jmourot at sdis69 dot fr

Description:
------------
Hi , i think there is a bug in the SMS.php / send method .
The send method error handling in "no batch mode" should be the same than in batch mode since the gateway returns an array and its key is the recipient too.

Regards

Test script:
---------------
it seems than $response[0] doesn't exist and that the array sould be accessed with $response[$recipient][0]

original code :
foreach ($message['to'] as $recipient) {
$response = $this->_send($message,$recipient);
if ($response[0] == 1) { ....

Replace ------
foreach ($message['to'] as $recipient) {
$response = $this->_send($message, $recipient);
if ($response[$recipient][0] == 1) {
/* Message was sent, store remote id if any. */
$remote_id = (isset($response[$recipient][1]) ? $response[$recipient][1] : null);
$error = null;
} else {
/* Message failed, store error code. */
$remote_id = null;
$error = $response[$recipient][1];
}