1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-30 00:59:48 +02:00

Check if each variable is in the symbol table.

Delete if not before passing into compact.
This commit is contained in:
David Li
2019-02-27 14:39:56 -05:00
parent 258e495451
commit f50353a952

View File

@@ -80,6 +80,11 @@ 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);
$vars = compact($varNames);
foreach ($varNames as $varName) {