diff options
author | JulienMoumne <julien@piwik.org> | 2012-12-16 22:25:33 +0400 |
---|---|---|
committer | JulienMoumne <julien@piwik.org> | 2012-12-16 22:25:33 +0400 |
commit | c96242fb6856c3a90d3b9bad623fe8115a5288b0 (patch) | |
tree | c0ea9a344c5b568395e0050122df0c0134f34646 /plugins/MobileMessaging/API.php | |
parent | f93f2d103755a03d3a02ecdaff02009a461b15c4 (diff) |
refs #3337#comment:7 remove white spaces in submitted phone number
git-svn-id: http://dev.piwik.org/svn/trunk@7639 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/MobileMessaging/API.php')
-rw-r--r-- | plugins/MobileMessaging/API.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/MobileMessaging/API.php b/plugins/MobileMessaging/API.php index c167505938..2a47f4498b 100644 --- a/plugins/MobileMessaging/API.php +++ b/plugins/MobileMessaging/API.php @@ -117,6 +117,8 @@ class Piwik_MobileMessaging_API { Piwik::checkUserIsNotAnonymous(); + $phoneNumber = self::sanitizePhoneNumber($phoneNumber); + $verificationCode = ""; for($i = 0; $i < self::VERIFICATION_CODE_LENGTH; $i++) { @@ -144,6 +146,18 @@ class Piwik_MobileMessaging_API } /** + * sanitize phone number + * + * @param string $phoneNumber + * + * @return string sanitized phone number + */ + public static function sanitizePhoneNumber($phoneNumber) + { + return str_replace(' ', '', $phoneNumber); + } + + /** * send a SMS * * @param string $phoneNumber |