Fixed issue with downloaded package when installing a testing release

This commit is contained in:
Djamil Legato
2017-01-19 12:56:58 -08:00
parent 4a68d3501b
commit 39ef71f5d2
2 changed files with 11 additions and 1 deletions

View File

@@ -222,7 +222,11 @@ class Gpm
$tmp_dir = Admin::getTempDir() . '/Grav-' . uniqid();
Folder::mkdir($tmp_dir);
$filename = $package->slug . basename($package->zipball_url);
$bad_chars = array_merge(
array_map('chr', range(0, 31)),
array("<", ">", ":", '"', "/", "\\", "|", "?", "*"));
$filename = $package->slug . str_replace($bad_chars, "", basename($package->zipball_url));
file_put_contents($tmp_dir . DS . $filename . '.zip', $contents);