onlinecity / php-smpp

PHP 5 based SMPP client library
232 stars 160 forks source link

Fix CSMS not working with CSMS_16BIT_TAGS #36

Closed gpedic closed 9 years ago

gpedic commented 9 years ago

Sending multipart SMS with the default csms_method CSMS_16BIT_TAGS will never work because of the way this comparison is set up. SmppClient::CSMS_PAYLOAD is 1 SmppClient::CSMS_16BIT_TAGS is 0

Therefore (!SmppClient::CSMS_16BIT_TAGS != SmppClient::CSMS_PAYLOAD) will be false.

As far as I can see the only case where we don't need $parts later on is when self::$csms_method == CSMS_PAYLOAD.

cypres commented 9 years ago

Thank you. I can't believe that bug persisted for two years.

gpedic commented 9 years ago

I'm glad to help, also thank you for sharing your code. I'm using your library in a project and this issue just popped up, good thing I didn't take a look at the FAQ before I found the problem or I probably would just have changed the csms method :)