From 0ea59cea1f2d943670adea5699db0242ee3a507e Mon Sep 17 00:00:00 2001 From: Diego Pino Navarro Date: Sat, 11 Feb 2023 17:37:37 -0300 Subject: [PATCH] Simpler/but more logic way for checking for non printable/printable chars --- .../StrawberryRunnersPostProcessor/TextPostProcessor.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Plugin/StrawberryRunnersPostProcessor/TextPostProcessor.php b/src/Plugin/StrawberryRunnersPostProcessor/TextPostProcessor.php index 7d08f67..e5c83e2 100644 --- a/src/Plugin/StrawberryRunnersPostProcessor/TextPostProcessor.php +++ b/src/Plugin/StrawberryRunnersPostProcessor/TextPostProcessor.php @@ -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); } }