kalkun-sms / Kalkun

Open Source Web based SMS Manager
https://kalkun.sourceforge.io/
GNU General Public License v2.0
211 stars 129 forks source link

Phone format check error with 3 comma separated numbers #478

Closed pjunyent closed 1 year ago

pjunyent commented 1 year ago

Describe the bug When sending sms manually ("input manually") to 3 or more spanish numbers (format 600000000 or +34600000000) separated by commas this error happens: "The string supplied did not seem to be a phone number."

To Reproduce Steps to reproduce the behavior:

  1. Go to kalkun main page.
  2. Click on "compose".
  3. Select "input manually"
  4. Write in the input box 3 or more spanish numbers (e.g. "+34600000000, +34600000000, +34600000000")
  5. Red error message: "The string supplied did not seem to be a phone number."

Expected behavior You should be able to send messages to 3 or more spanish numbers.

Screenshots Captura desde 2022-10-12 11-42-02

Browser, kalkun setup, database setup..:

Additional context Error happens at /application/helpers/kalkun_helper.php, line 448. It seems related to kalkun's implementation of \libphonenumber being unable to recognised the string as three valid phone numbers. I was able to bypass this issue by running this commands through my dockerfile & it worked, albeit it did not check the phonenumber format obviously:

RUN /bin/busybox sed -i "s|tr(\'Please specify a valid mobile phone number\')|TRUE|g" /var/www/application/helpers/kalkun_helper.php \  
&& /bin/busybox sed -i "s|\$e->getMessage()|TRUE|g" /var/www/application/helpers/kalkun_helper.php
tenzap commented 1 year ago

Precisely that use case is indeed not supported. You must enter in single number when using the "Input manually" option. The value you enter for the phonenumber is checked as is by libphonenumber-for-php.

For your use case you may:

tenzap commented 1 year ago

May you please check if the last commit (https://github.com/kalkun-sms/Kalkun/commit/1e1745597e5ec6f05dc274d1af03b468b3a7639c) on https://github.com/kalkun-sms/Kalkun/tree/fix-478

pjunyent commented 1 year ago

Works great, thanks for the fix!

tenzap commented 1 year ago

Reopen, until this is pushed to devel (after 0.8.0 release).