From c580d24e1b347578f35a3a21abbc7c96d543d4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Fri, 5 Jan 2018 14:35:09 +0200 Subject: [PATCH] simplify return statement --- lib/Minify/Source.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Minify/Source.php b/lib/Minify/Source.php index d7f83ef..0ac4921 100644 --- a/lib/Minify/Source.php +++ b/lib/Minify/Source.php @@ -180,8 +180,13 @@ class Minify_Source implements Minify_SourceInterface } else { $content = file_get_contents($this->filepath); } + // remove UTF-8 BOM if present - return ("\xEF\xBB\xBF" === substr($content, 0, 3)) ? substr($content, 3) : $content; + if (strpos($content, "\xEF\xBB\xBF") === 0) { + return substr($content, 3); + } + + return $content; } /**