ushahidi/Ushahidi_Web — Issue #229: Clickatell and 32-bit server - phone number overflows when string to int
Author: aoduor
Created: 2012-02-16 17:43:55+00:00
State: open
Labels: Bug, P4 - Normal

"I am using Clickatell with Ushahidi with US numbers. I set everything up but was not able to send replys to the incoming messages. Clickatell would return Error 114: cannot route message. I think found the problem.

On line 284 in application/controllers/admin/message.php intval() is called on the message_from field which is a string.

I am using a 32-bit server. My personal phone number which I am testing with starts with '1949#######'. If you look at the docs for intval my number is outside that int range so the number that gets POST'ed to Clickatell is 2147483647 (I verified this with debugging output).

The phone number gets POST'ed to clickatell as a string, so the workaround for me is to just keep it as a string. Maybe there is another plugin which requires this to be an int? Or am I missing something?

Here is a suggested diff:
https://github.com/nexleaf/Ushahidi_Web/commit/c5e3b792c47b94d53658f4c669a6b22a56728cc9.diff" - Martin