File tree 1 file changed +2
-2
lines changed
src/Symfony/Component/Notifier/Bridge/LightSms
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ protected function doSend(MessageInterface $message): SentMessage
123
123
throw new TransportException ('Unable to send the SMS: ' .self ::ERROR_CODES [$ content ['error ' ]], $ response );
124
124
}
125
125
126
- $ phone = preg_replace ( " /[^\d]/ " , '' , $ message ->getPhone ());
126
+ $ phone = $ this -> escapePhoneNumber ( $ message ->getPhone ());
127
127
if (32 === $ content [$ phone ]['error ' ]) {
128
128
throw new TransportException ('Unable to send the SMS: ' .self ::ERROR_CODES [$ content ['error ' ]], $ response );
129
129
}
@@ -159,6 +159,6 @@ private function escapeSubject($subject): string
159
159
160
160
private function escapePhoneNumber ($ phoneNumber ): string
161
161
{
162
- return str_replace ( ' + ' , '' , $ phoneNumber );
162
+ return preg_replace ( " /[^\d]/ " , '' , $ phoneNumber );
163
163
}
164
164
}
You can’t perform that action at this time.
0 commit comments