Skip to content

Commit

Permalink
[BUGFIX] Correctly check if storagePid key exists in array (#1241)
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrycze-volk committed May 31, 2024
1 parent 404c697 commit 3db814c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Classes/Common/AbstractDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ public static function &getInstance(string $location, array $settings = [], bool
}

// Sanitize input.
$pid = $settings['storagePid'] ? max((int) $settings['storagePid'], 0) : 0;
$pid = array_key_exists('storagePid', $settings) ? max((int) $settings['storagePid'], 0) : 0;
if ($documentFormat == 'METS') {
$instance = new MetsDocument($pid, $location, $xml, $settings);
} elseif ($documentFormat == 'IIIF') {
Expand Down

0 comments on commit 3db814c

Please sign in to comment.