From 2f33b69786834d11e0e80c73e78d68edcae09a92 Mon Sep 17 00:00:00 2001 From: Matthias Zronek Date: Mon, 28 Oct 2019 11:03:44 +0100 Subject: [PATCH] Bugfix for option sanitizer --- lib/Minify/App.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Minify/App.php b/lib/Minify/App.php index 9ee4a1e..bc885b2 100644 --- a/lib/Minify/App.php +++ b/lib/Minify/App.php @@ -80,10 +80,12 @@ class App extends Container }; $varNames = array_map($prefixer, $propNames); - $varDefinedChecker = function ($name) { - return array_key_exists($name, get_defined_vars()); - }; - $varNames = array_filter($varNames, $varDefinedChecker); + $varDefined = get_defined_vars(); + + $varNames = array_filter($varNames, function($name) use($varDefined) + { + return array_key_exists($name, $varDefined); + }); $vars = compact($varNames);