Skip to content

Commit

Permalink
Strict check for preg_replace output
Browse files Browse the repository at this point in the history
  • Loading branch information
GreyWyvern committed Jan 31, 2024
1 parent 11c36fe commit 92a23cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Smalot/PdfParser/Encoding.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ protected function getEncodingClass(): string
$baseEncoding = preg_replace('/[^A-Z0-9]/is', '', $this->get('BaseEncoding')->getContent());

// Check for empty BaseEncoding field value
if ('' == $baseEncoding) {
if (!\is_string($baseEncoding) || 0 == \strlen($baseEncoding)) {
$baseEncoding = 'StandardEncoding';
}

Expand Down

0 comments on commit 92a23cc

Please sign in to comment.