From bcf3b761cdc4fa01939a285f834178ec730b1626 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 24 Apr 2018 19:25:59 +0200 Subject: [PATCH] Fix unicode check --- Security/PhpCode.php | 2 +- Utils/ArrayUtils.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Security/PhpCode.php b/Security/PhpCode.php index b70039a69..b9883c9ba 100644 --- a/Security/PhpCode.php +++ b/Security/PhpCode.php @@ -79,7 +79,7 @@ class PhpCode */ public static function hasUnicode(string $source) : bool { - return (bool) preg_match('/[^\x20-\x7f]/', $source) || !mb_check_encoding($source, 'ASCII'); + return (bool) preg_match('/[^\x00-\x7f]/', $source); } /** diff --git a/Utils/ArrayUtils.php b/Utils/ArrayUtils.php index cb197ac34..f93fdfa8a 100644 --- a/Utils/ArrayUtils.php +++ b/Utils/ArrayUtils.php @@ -325,7 +325,6 @@ class ArrayUtils */ public static function arrayFlatten(array $array) : array { - // see collection collapse as alternative?! $flat = []; $stack = array_values($array);