8000 * LightSmsTransport.php - changed login for validation (the same like… · symfony/symfony@fc13bb2 · GitHub
[go: up one dir, main page]

Skip to content

Commit fc13bb2

Browse files
author
Vasilij Dusko | CREATION
committed
* LightSmsTransport.php - changed login for validation (the same like we have all places)
1 parent 5d2e692 commit fc13bb2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ protected function doSend(MessageInterface $message): SentMessage
123123
throw new TransportException('Unable to send the SMS: '.self::ERROR_CODES[$content['error']], $response);
124124
}
125125

126-
$phone = preg_replace("/[^\d]/", '', $message->getPhone());
126+
$phone = $this->escapePhoneNumber($message->getPhone());
127127
if (32 === $content[$phone]['error']) {
128128
throw new TransportException('Unable to send the SMS: '.self::ERROR_CODES[$content['error']], $response);
129129
}
@@ -159,6 +159,6 @@ private function escapeSubject($subject): string
159159

160160
private function escapePhoneNumber($phoneNumber): string
161161
{
162-
return str_replace('+', '', $phoneNumber);
162+
return preg_replace("/[^\d]/", '', $phoneNumber);
163163
}
164164
}

0 commit comments

Comments
 (0)
0