Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1c993b7

Browse filesBrowse files
author
Vasilij Dusko | CREATION
committed
* ERROR_CODES -> int
* www. - bug * isset validate ['error']
1 parent 1b59a7d commit 1c993b7
Copy full SHA for 1c993b7

File tree

Expand file treeCollapse file tree

1 file changed

+43
-42
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+43
-42
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Notifier/Bridge/LightSms/LightSmsTransport.php
+43-42Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -33,46 +33,46 @@ final class LightSmsTransport extends AbstractTransport
3333
private $from;
3434

3535
private const ERROR_CODES = [
36-
'000' => 'Service unavailable',
37-
'1' => 'Missing Signature',
38-
'2' => 'Login not specified',
39-
'3' => 'Text not specified',
40-
'4' => 'Phone number not specified',
41-
'5' => 'Sender not specified',
42-
'6' => 'Invalid signature',
43-
'7' => 'Invalid login',
44-
'8' => 'Invalid sender name',
45-
'9' => 'Sender name not registered',
46-
'10' => 'Sender name not approved',
47-
'11' => 'There are forbidden words in the text',
48-
'12' => 'Error in SMS sending',
49-
'13' => 'Phone number is in the blackist. SMS sending to this number is forbidden.',
50-
'14' => 'There are more than 50 numbers in the request',
51-
'15' => 'List not specified',
52-
'16' => 'Invalid phone number',
53-
'17' => 'SMS ID not specified',
54-
'18' => 'Status not obtained',
55-
'19' => 'Empty response',
56-
'20' => 'The number already exists',
57-
'21' => 'No name',
58-
'22' => 'Template already exists',
59-
'23' => 'Missing Month (Format: YYYY-MM)',
60-
'24' => 'Timestamp not specified',
61-
'25' => 'Error in access to the list',
62-
'26' => 'There are no numbers in the list',
63-
'27' => 'No valid numbers',
64-
'28' => 'Missing start date (Format: YYYY-MM-DD)',
65-
'29' => 'Missing end date (Format: YYYY-MM-DD)',
66-
'30' => 'No date (format: YYYY-MM-DD)',
67-
'31' => 'Closing direction to the user',
68-
'32' => 'Not enough money',
69-
'33' => 'Missing phone number',
70-
'34' => 'Phone is in stop list',
71-
'35' => 'Not enough money',
72-
'36' => 'Can not obtain information about phone',
73-
'37' => 'Base Id is not set',
74-
'38' => 'Phone number already exists in this database',
75-
'39' => 'Phone number does not exist in this database',
36+
000 => 'Service unavailable',
37+
1 => 'Missing Signature',
38+
2 => 'Login not specified',
39+
3 => 'Text not specified',
40+
4 => 'Phone number not specified',
41+
5 => 'Sender not specified',
42+
6 => 'Invalid signature',
43+
7 => 'Invalid login',
44+
8 => 'Invalid sender name',
45+
9 => 'Sender name not registered',
46+
10 => 'Sender name not approved',
47+
11 => 'There are forbidden words in the text',
48+
12 => 'Error in SMS sending',
49+
13 => 'Phone number is in the blackist. SMS sending to this number is forbidden.',
50+
14 => 'There are more than 50 numbers in the request',
51+
15 => 'List not specified',
52+
16 => 'Invalid phone number',
53+
17 => 'SMS ID not specified',
54+
18 => 'Status not obtained',
55+
19 => 'Empty response',
56+
20 => 'The number already exists',
57+
21 => 'No name',
58+
22 => 'Template already exists',
59+
23 => 'Missing Month (Format: YYYY-MM)',
60+
24 => 'Timestamp not specified',
61+
25 => 'Error in access to the list',
62+
26 => 'There are no numbers in the list',
63+
27 => 'No valid numbers',
64+
28 => 'Missing start date (Format: YYYY-MM-DD)',
65+
29 => 'Missing end date (Format: YYYY-MM-DD)',
66+
30 => 'No date (format: YYYY-MM-DD)',
67+
31 => 'Closing direction to the user',
68+
32 => 'Not enough money',
69+
33 => 'Missing phone number',
70+
34 => 'Phone is in stop list',
71+
35 => 'Not enough money',
72+
36 => 'Can not obtain information about phone',
73+
37 => 'Base Id is not set',
74+
38 => 'Phone number already exists in this database',
75+
39 => 'Phone number does not exist in this database',
7676
];
7777

7878
public function __construct(string $login, string $password, string $from, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
@@ -105,7 +105,7 @@ protected function doSend(MessageInterface $message): SentMessage
105105
$signature = $this->generateSignature($message, $timestamp);
106106

107107
$endpoint = sprintf(
108-
'https://www.%s/external/get/send.php?login=%s&signature=%s&phone=%s&text=%s&sender=%s&timestamp=%s',
108+
'https://%s/external/get/send.php?login=%s&signature=%s&phone=%s&text=%s&sender=%s&timestamp=%s',
109109
$this->getEndpoint(),
110110
$this->login,
111111
$signature,
@@ -123,7 +123,8 @@ protected function doSend(MessageInterface $message): SentMessage
123123

124124
$content = $response->toArray(false);
125125

126-
if (isset($content[''])) {
126+
// it happens if the host without www
127+
if (isset($content['']) && isset($content['']['error'])) {
127128
throw new TransportException('Unable to send the SMS: '.self::ERROR_CODES[$content['']['error']], $response);
128129
}
129130

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.