Skip to content

Commit b67a2da

Browse files
committed
Fix: getModules() should return empty string if no modules are attached
1 parent 4a70ca1 commit b67a2da

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/Parameters/CreateMeetingParameters.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,22 @@ public function getPresentations(): array
391391
public function getModules(): string
392392
{
393393
$xml = new SimpleXMLElementExtended('<?xml version="1.0" encoding="UTF-8"?><modules/>');
394+
// Get empty xml as string
395+
$emptyXML = $xml->asXML();
396+
397+
// Add modules
394398
$this->addPresentationsModule($xml);
395399
$this->addClientSettingsOverrideModule($xml);
396400

397-
return $xml->asXML();
401+
// Get xml as string after modules have been added
402+
$resultXML = $xml->asXML();
403+
404+
// If xml was not modified (no modules added), return an empty string
405+
if ($emptyXML === $resultXML) {
406+
return '';
407+
}
408+
409+
return $resultXML;
398410
}
399411

400412
public function addClientSettingsOverrideModule(SimpleXMLElementExtended $xml): void

0 commit comments

Comments
 (0)