Fix #635 use mv instead of rename as that does not support cross volume operations

This commit is contained in:
Flavio Copes
2016-12-14 22:40:42 +01:00
parent 1125b51f27
commit d61d260ef1
2 changed files with 7 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
1. [](#bugfix)
* Fixed case where extracting a package would cause an error during rename
* Fixed [#635](https://github.com/getgrav/grav/issues/635) use mv instead of rename as that does not support cross volume operations
# v1.1.9
## 12/13/2016

View File

@@ -340,11 +340,13 @@ abstract class Folder
// Make sure that path to the target exists before moving.
self::create(dirname($target));
// Just rename the directory.
$success = @rename($source, $target);
error_clear_last();
if (!$success) {
$error = error_get_last();
// Just rename the directory.
exec("mv $source $target");
$error = error_get_last();
if ($error) {
throw new \RuntimeException($error['message']);
}