I have recently installed modules SMS Framework 6.x-2.x-dev (and SMS Vianett 6.x-1.0-beta1 as gateway).

I did try the Send To Phone feature, which lets you send current website page's link as SMS text to any mobilephonenumber entered in the textfield, and it works. But the sent link is broken in the received SMS text message.

Example if I send 'http://www.domain.com/news' it will display in the receiver's SMS as 'http:/%2Fwww.domain.com/news'.

I was told that the input needs URL encode before it is sent to a gateway server. The URL has to be converted into a valid ASCII format. Further, PHP has a rawurlencode() function.
But I don't know how to use it...

Where could it possible be wrong? Is there any way to fix this in this module?

// I would appreciate any suggestions!!

Comments

univate’s picture

Project: SMS Framework » SMS Vianett
Version: 6.x-2.x-dev » 6.x-1.0-beta1
Component: Send to Phone » Code

%2F is the '/' character - http://www.w3schools.com/tags/ref_urlencode.asp

A fix for this is more likely going to need to be made in the sms vianett module.

miccelito’s picture

Thanks for reply

Yes, you're surely right. I had a look at the sms_vianett.module and I guess the error comes from the code that seems to need a fix.

At line 97 in the sms_vianett.module:
$msg = drupal_urlencode($data['message']);

I guess instead it should be something like:

// Check if the message requires unicode handling
      if ($unicode_message = sms_vianett_unicode($data['message'])) {
				$msg = $unicode_message;
			}
      else {
				$msg = drupal_urlencode($data['message']);
			}

or

// Check if the message requires unicode handling
      if ($unicode_message = sms_vianett_unicode($data['message'])) {
				$msg = urlencode($data['message']);
			}
      else {
				$msg = drupal_urlencode($data['message']);
			}

or

// Check if the message requires unicode handling
      if ($unicode_message = sms_vianett_unicode($data['message'])) {
        $msg = $unicode_message;
      }
      else {
        $msg = rawurlencode($data['message']);
      }
miccelito’s picture

Problem solved, a small change in the module's code was needed for correct URL encoding.

$msg = drupal_urlencode($data['message']);

$msg = rawurlencode($data['message']);

miccelito’s picture

Issue summary: View changes

Added more info to the issue