Skip to content

Commit

Permalink
Simpler/but more logic way for checking for non printable/printable
Browse files Browse the repository at this point in the history
chars
  • Loading branch information
DiegoPino committed Feb 11, 2023
1 parent dbac9cf commit 0ea59ce
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 0ea59ce

Please sign in to comment.