fixed a bug of movefile function on filehandler class

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10190 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2012-02-24 09:22:03 +00:00
parent 270a9aeb86
commit ecf2f74c41

View file

@ -148,7 +148,12 @@ class FileHandler {
*/ */
function moveFile($source, $target) { function moveFile($source, $target) {
$source = FileHandler::getRealPath($source); $source = FileHandler::getRealPath($source);
return (file_exists($source) && FileHandler::removeFile($target) && FileHandler::rename($source, $target)); if(!file_exists($source))
{
return FALSE;
}
FileHandler::removeFile($target);
return FileHandler::rename($source, $target));
} }
/** /**