Skip to content

Commit

Permalink
Remove leading slash when required
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Thoolen authored and Progi1984 committed Dec 11, 2023
1 parent 8303744 commit 36003c4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Common/XMLReader.php
Expand Up @@ -61,6 +61,12 @@ public function getDomFromZip(string $zipFile, string $xmlFile)
$zip = new \ZipArchive();
$zip->open($zipFile);
$content = $zip->getFromName($xmlFile);

// Files downloaded from Sharepoint are somehow different and fail on the leading slash.
if ($content === false && substr($xmlFile, 0, 1) === '/') {
$content = $zip->getFromName(substr($xmlFile, 1));
}

$zip->close();

if ($content === false) {
Expand Down

0 comments on commit 36003c4

Please sign in to comment.