Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulienMoumne <julien@piwik.org>2012-12-16 22:25:33 +0400
committerJulienMoumne <julien@piwik.org>2012-12-16 22:25:33 +0400
commitc96242fb6856c3a90d3b9bad623fe8115a5288b0 (patch)
treec0ea9a344c5b568395e0050122df0c0134f34646 /plugins/MobileMessaging/API.php
parentf93f2d103755a03d3a02ecdaff02009a461b15c4 (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.php14
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