Skip to content

Commit

Permalink
Fixed a bug where no input for search caused a JSMin error
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed Jul 3, 2022
1 parent d333282 commit 672ada7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions system/classes/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@

namespace Geeklog;

use Exception;
use JSMin\JSMin;
use JSMin\UnterminatedRegExpException;
use JSMin\UnterminatedStringException;
use MatthiasMullie\Minify;
use Mobile_Detect;

Expand Down Expand Up @@ -817,8 +820,15 @@ private function minifyJS(array $paths)
$data = @file_get_contents($path);

if ($data !== false) {
$data = JSMin::minify($data);
$retval .= $data . PHP_EOL;
try {
// Workaround
$oldErrorReporting = error_reporting();
error_reporting($oldErrorReporting & !E_DEPRECATED);
$data = JSMin::minify($data);
error_reporting($oldErrorReporting);
$retval .= $data . PHP_EOL;
} catch (Exception $e) {
}
}
}
}
Expand Down

0 comments on commit 672ada7

Please sign in to comment.