Skip to content

Commit

Permalink
Only apply list simplification for strings.
Browse files Browse the repository at this point in the history
Only do this for strings. If it's a single element list but the value is an array, leave it so it makes better sense.
  • Loading branch information
GreyWyvern committed Jun 30, 2023
1 parent 5bf3d0a commit 56f8224
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Smalot/PdfParser/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ public function extractXMPMetadata(string $content): void
break;

case 'close':
// If the value of this item is a single element
// array of just one list item, use the value of
// the first list item as the value for this
// property
if (is_array($metadata) && isset($metadata[0]) && count($metadata) == 1) {
// If the value of this property is a single-
// element array where the element is of type
// string, use the value of the first list item
// as the value for this property
if (is_array($metadata) && isset($metadata[0]) && count($metadata) == 1 && is_string($metadata[0])) {
$metadata = $metadata[0];
}

Expand Down

0 comments on commit 56f8224

Please sign in to comment.