mirror of
https://github.com/getgrav/grav.git
synced 2026-07-07 21:51:48 +02:00
Ensure file permissions are preserved during safe-upgrade copy operations
This commit is contained in:
@@ -503,6 +503,10 @@ class SafeUpgradeService
|
||||
if (!@copy($source, $destination)) {
|
||||
throw new RuntimeException(sprintf('Failed to copy file "%s" to "%s".', $source, $destination));
|
||||
}
|
||||
$perms = @fileperms($source);
|
||||
if ($perms !== false) {
|
||||
@chmod($destination, $perms & 0777);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user