Skip to content

Commit fc4c549

Browse files
author
Pascal Wacker
committed
removing restrictions to make it compatible with thingstream.io
1 parent 31eb5fa commit fc4c549

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

MQTTClient.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,12 @@ public function sendConnect($clientId, $cleanSession=false, $keepAlive=10, $time
221221
if (!$this->serverAddress) return false;
222222

223223
// Basic validation of clientid
224-
if(preg_match("/[^0-9a-zA-Z]/",$clientId)) {
225-
$this->debugMessage('ClientId can only contain characters 0-9,a-z,A-Z');
224+
if(preg_match("/[^0-9a-zA-Z:-]/",$clientId)) {
225+
$this->debugMessage('ClientId can only contain characters 0-9,a-z,A-Z,:,-');
226226
return false;
227227
}
228-
if(strlen($clientId) > 23) {
229-
$this->debugMessage('ClientId max length is 23 characters/numbers');
228+
if(strlen($clientId) > 63) {
229+
$this->debugMessage('ClientId max length is 63 characters/numbers');
230230
return false;
231231
}
232232
$this->clientId = $clientId;

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "pascalwacker/php-mqtt-client",
33
"description": "MQTT 3.1.1 library for PHP with TLS support",
44
"keywords": [ "mqtt", "client", "php" ],
5-
"version": "1.0.2",
5+
"version": "1.0.3",
66
"license": "MIT",
77
"authors": [
88
{

0 commit comments

Comments
 (0)