Skip to content

Commit 3ec6f3b

Browse files
committed
strip slashes for SMS text
1 parent ec0339d commit 3ec6f3b

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

LICENSE

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
MIT License
22

3-
Copyright (c) 2019-present sms77 e.K.
3+
Copyright (c) 2019-2022 sms77 e.K.
4+
Copyright (c) 2023-present seven communications GmbH & Co. KG
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +19,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1819
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1920
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2021
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
22+
SOFTWARE.

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Sms77.io Logo](https://www.sms77.io/wp-content/uploads/2019/07/sms77-Logo-400x79.png "Sms77.io Logo")
1+
![](https://www.seven.io/wp-content/uploads/Logo.svg "seven Logo")
22

33
# Official PHP API Client
44

@@ -11,7 +11,7 @@ composer require sms77/api
1111
```
1212

1313
Alternatively you
14-
can [download as *.ZIP](https://github.com/sms77io/php-client/releases/latest "download as *.ZIP")
14+
can [download as *.ZIP](https://github.com/seven-io/php-client/releases/latest "download as *.ZIP")
1515
if you don't use Composer.
1616

1717
### Usage
@@ -162,6 +162,6 @@ particular API key. SMS77_RECIPIENT is the recipient of the test SMS.
162162

163163
###### Support
164164

165-
Need help? Feel free to [contact us](https://www.sms77.io/en/company/contact/).
165+
Need help? Feel free to [contact us](https://www.seven.io/en/company/contact/).
166166

167167
[![MIT](https://img.shields.io/badge/License-MIT-teal.svg)](./LICENSE)

composer.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"authors": [
33
{
4-
"email": "a.matthies@sms77.io",
5-
"homepage": "https://www.sms77.io",
6-
"name": "sms77 e.K.",
4+
"email": "support@seven.io",
5+
"homepage": "https://www.seven.io",
6+
"name": "seven communications GmbH & Co. KG",
77
"role": "Developer"
88
}
99
],
@@ -22,8 +22,8 @@
2222
"php": "7.3"
2323
}
2424
},
25-
"description": "Official API Client for requesting the Sms77.io SMS Gateway.",
26-
"homepage": "https://github.com/sms77io/php-client",
25+
"description": "Official API Client for requesting the seven.io SMS Gateway.",
26+
"homepage": "https://github.com/seven-io/php-client",
2727
"keywords": [
2828
"2fa",
2929
"sms",
@@ -49,10 +49,10 @@
4949
"ext-simplexml": "*"
5050
},
5151
"support": {
52-
"docs": "https://github.com/sms77io/php-client",
53-
"email": "support@sms77.io",
54-
"rss": "https://www.sms77.io/de/feed/",
55-
"source": "https://github.com/sms77io/php-client"
52+
"docs": "https://github.com/seven-io/php-client",
53+
"email": "support@seven.io",
54+
"rss": "https://www.seven.io/en/feed/",
55+
"source": "https://github.com/seven-io/php-client"
5656
},
5757
"type": "library"
5858
}

src/BaseClient.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,16 @@ private function request(string $path, string $method, array $options = []) {
7676
];
7777
$url = self::BASE_URI . "/$path";
7878
$params = http_build_query($options);
79-
self::HTTP_GET === $method && $url .= "?$params";
79+
if (self::HTTP_GET === $method) $url .= "?$params";
8080

8181
$ch = curl_init($url);
8282

8383
if (self::HTTP_POST === $method) {
84+
if ($path === 'sms') {
85+
$headers[] = 'Content-Type: application/json';
86+
$params = stripslashes(json_encode($options));
87+
}
88+
8489
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
8590
curl_setopt($ch, CURLOPT_POST, true);
8691
}
@@ -125,4 +130,4 @@ protected function post(string $path, array $options = []) {
125130
protected function get(string $path, array $options = []) {
126131
return $this->request($path, self::HTTP_GET, $options);
127132
}
128-
}
133+
}

0 commit comments

Comments
 (0)