Skip to content

Commit

Permalink
Merge pull request #78 from esmero/ISSUE-77
Browse files Browse the repository at this point in the history
ISSUE-77: Fix binary detection for Text extraction
  • Loading branch information
DiegoPino authored Feb 14, 2023
2 parents dbac9cf + 0ea59ce commit 423a913
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -476,14 +476,13 @@ public function isXmlMime($mime_type): bool {
}

/**
* Determine whether the given value is a binary string by checking to see if it has detectable character encoding.
* Determine whether the given value is a binary string. From Symfony DB debug.
*
* @param string $value
*
* @return bool
*/
private function isBinary($value): bool
{
return false === mb_detect_encoding((string)$value, null, true);
private function isBinary($value): bool {
return !preg_match('//u', $value);
}
}

0 comments on commit 423a913

Please sign in to comment.