mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
FIX Making path names consistent
I've changed the variables to use the absolute path as the path is unhelpful for debugging and this is more consistent with the other lines of code below
This commit is contained in:
parent
80bcf5e713
commit
295f76e331
@ -527,13 +527,13 @@ class File extends DataObject {
|
|||||||
if(!is_a($this, 'Folder')) {
|
if(!is_a($this, 'Folder')) {
|
||||||
// Only throw a fatal error if *both* before and after paths don't exist.
|
// Only throw a fatal error if *both* before and after paths don't exist.
|
||||||
if(!file_exists($pathBeforeAbs)) {
|
if(!file_exists($pathBeforeAbs)) {
|
||||||
throw new Exception("Cannot move $pathBefore to $pathAfter - $pathBefore doesn't exist");
|
throw new Exception("Cannot move $pathBeforeAbs to $pathAfterAbs - $pathBeforeAbs doesn't exist");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that target directory (not the file itself) exists.
|
// Check that target directory (not the file itself) exists.
|
||||||
// Only check if we're dealing with a file, otherwise the folder will need to be created
|
// Only check if we're dealing with a file, otherwise the folder will need to be created
|
||||||
if(!file_exists(dirname($pathAfterAbs))) {
|
if(!file_exists(dirname($pathAfterAbs))) {
|
||||||
throw new Exception("Cannot move $pathBefore to $pathAfter - Directory " . dirname($pathAfter)
|
throw new Exception("Cannot move $pathBeforeAbs to $pathAfterAbs - Directory " . dirname($pathAfter)
|
||||||
. " doesn't exist");
|
. " doesn't exist");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user