Skip to content

Commit b1b0842

Browse files
committed
Improve processXmlResponse in BigBlueButton main class.
1 parent fabcf73 commit b1b0842

File tree

4 files changed

+8
-39
lines changed

4 files changed

+8
-39
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ matrix:
2222
env:
2323
global:
2424
- BBB_SECRET=8cd8ef52e8e101574e400365b55e11a6
25-
- BBB_SERVER_BASE_URL=http://test-install.blindsidenetworks.com/bigbluebutton/
25+
- BBB_SERVER_BASE_URL=https://test-install.blindsidenetworks.com/bigbluebutton/
2626

2727
before_script:
2828
- wget http://getcomposer.org/composer.phar

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
},
2525
"require": {
2626
"php": ">=5.4",
27-
"ext-curl": "*"
27+
"ext-curl": "*",
28+
"ext-simplexml": "*",
29+
"ext-mbstring": "*"
2830
},
2931
"require-dev": {
3032
"php": ">=7.0",

src/BigBlueButton.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -368,19 +368,19 @@ private function processXmlResponse($url, $payload = '', $contentType = 'applica
368368
throw new \RuntimeException('Unhandled curl error: ' . curl_error($ch));
369369
}
370370
$timeout = 10;
371-
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
371+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
372372
curl_setopt($ch, CURLOPT_ENCODING, 'UTF-8');
373373
curl_setopt($ch, CURLOPT_URL, $url);
374374
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
375375
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
376-
if ($payload != '') {
376+
if (!empty($payload)) {
377377
curl_setopt($ch, CURLOPT_HEADER, 0);
378378
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
379379
curl_setopt($ch, CURLOPT_POST, 1);
380380
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
381381
curl_setopt($ch, CURLOPT_HTTPHEADER, [
382382
'Content-type: ' . $contentType,
383-
'Content-length: ' . strlen($payload),
383+
'Content-length: ' . mb_strlen($payload),
384384
]);
385385
}
386386
$data = curl_exec($ch);
@@ -390,18 +390,8 @@ private function processXmlResponse($url, $payload = '', $contentType = 'applica
390390
curl_close($ch);
391391

392392
return new SimpleXMLElement($data);
393-
}
394-
395-
if ($payload != '') {
393+
} else {
396394
throw new \RuntimeException('Post XML data set but curl PHP module is not installed or not enabled.');
397395
}
398-
399-
try {
400-
$response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
401-
402-
return new SimpleXMLElement($response);
403-
} catch (\RuntimeException $e) {
404-
throw new \RuntimeException('Failover curl error: ' . $e->getMessage());
405-
}
406396
}
407397
}

src/Exceptions/ChecksumException.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)