Make filenames more windows-friendly to avoid issues

This commit is contained in:
Andy Miller
2017-03-20 13:32:03 -06:00
parent 1acc936a5f
commit 5e4a829625
2 changed files with 3 additions and 0 deletions

View File

@@ -3,6 +3,8 @@
1. [](#new)
* Improved `range` form field with touch and counter support [#1016](https://github.com/getgrav/grav-plugin-admin/pull/1016)
1. [](#bugfix)
* Cleanup package files via GPM install to make them more windows-friendly [#1361](https://github.com/getgrav/grav/pull/1361)
# v1.3.0-rc.2
## 03/17/2017

View File

@@ -302,6 +302,7 @@ class Gpm
$bad_chars = array_merge(array_map('chr', range(0, 31)), ["<", ">", ":", '"', "/", "\\", "|", "?", "*"]);
$filename = $package->slug . str_replace($bad_chars, "", basename($package->zipball_url));
$filename = preg_replace('/[\\\\\/:"*?&<>|]+/mi', '-', $filename);
file_put_contents($tmp_dir . DS . $filename . '.zip', $contents);