1
0
mirror of https://github.com/nextcloud/ocsms.git synced 2026-08-21 21:32:59 +00:00

Definitively resolve spaces issue

This commit is contained in:
Loic Blot
2014-10-23 08:04:48 +00:00
parent 1e21406f76
commit 8d28751d94
2 changed files with 25 additions and 3 deletions
+7
View File
@@ -127,11 +127,18 @@ class OcSmsApp extends App {
private function pushPhoneNumberToCache($rawPhone, $contactName) {
$phoneNb = preg_replace("#[ ]#", "/", $rawPhone);
$phoneNbNoSpaces = preg_replace("#[ ]#", "", $rawPhone);
self::$contacts[$phoneNb] = $contactName;
self::$contacts[$phoneNbNoSpaces] = $contactName;
if (!isset(self::$contactsInverted[$contactName])) {
self::$contactsInverted[$contactName] = array();
}
array_push(self::$contactsInverted[$contactName], $phoneNb);
if ($phoneNb != $phoneNbNoSpaces) {
array_push(self::$contactsInverted[$contactName], $phoneNbNoSpaces);
}
}
}