Home » Networking » Net_SMS » Bug #6578
Error in error handling
Details
| Submitted | 2006-01-25 13:38 UTC |
|---|---|
| From | jmourot at sdis69 dot fr |
| Assigned | yunosh |
| Status | Closed |
| Package | Net_SMS |
| PHP Version | 4.3.10 |
| OS | Win32 |
| 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];
}