mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-05-06 07:46:50 +02:00
Make filenames more windows-friendly to avoid issues
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user