diff options
author | Hans Duedal <hd@onlinecity.dk> | 2011-03-26 12:29:27 +0100 |
---|---|---|
committer | Hans Duedal <hd@onlinecity.dk> | 2011-03-26 12:29:27 +0100 |
commit | e877870dd01849b908b5621260edf05630df9d65 (patch) | |
tree | 3ba454553cc1149aae996180279765f3ab9fd374 | |
parent | 9197b6df55f7fc49eb28373f9e762c58897f15e8 (diff) | |
download | php-smpp-e877870dd01849b908b5621260edf05630df9d65.zip php-smpp-e877870dd01849b908b5621260edf05630df9d65.tar.gz php-smpp-e877870dd01849b908b5621260edf05630df9d65.tar.bz2 |
Fixed issue where DLRs containing multiple line text-snippets could not be parsed
-rw-r--r-- | gateway/protocol/smppclient.class.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gateway/protocol/smppclient.class.php b/gateway/protocol/smppclient.class.php index 6c4de5b..d7aedab 100644 --- a/gateway/protocol/smppclient.class.php +++ b/gateway/protocol/smppclient.class.php @@ -920,8 +920,10 @@ class DeliveryReceipt extends SMS */ public function parseDeliveryReceipt() { - $numMatches = preg_match('/^id:([^ ]+) sub:(\d{1,3}) dlvrd:(\d{3}) submit date:(\d{10}) done date:(\d{10}) stat:([A-Z]{7}) err:(\d{3}) text:(.*)$/', $this->message, $matches); - if ($numMatches == 0) throw new \InvalidArgumentException('Could not parse delivery receipt'); + $numMatches = preg_match('/^id:([^ ]+) sub:(\d{1,3}) dlvrd:(\d{3}) submit date:(\d{10}) done date:(\d{10}) stat:([A-Z]{7}) err:(\d{3}) text:(.*)$/ms', $this->message, $matches); + if ($numMatches == 0) { + throw new \InvalidArgumentException('Could not parse delivery receipt: '.$this->message."\n".bin2hex($this->body)); + } list($matched, $this->id, $this->sub, $this->dlvrd, $this->submitDate, $this->doneDate, $this->stat, $this->err, $this->text) = $matches; // Convert dates |