image: prevent overwrite on copy
Signed-off-by: Varun Patil <varunpatil@ucla.edu>pull/579/head
parent
e2408a5111
commit
7e88bc4248
|
@ -310,6 +310,11 @@ class ImageController extends GenericApiController
|
|||
throw Exceptions::ForbiddenFileUpdate($file->getName());
|
||||
}
|
||||
|
||||
// Check if target copy file exists
|
||||
if ($copy && $file->getParent()->nodeExists($name)) {
|
||||
throw Exceptions::ForbiddenFileUpdate($name);
|
||||
}
|
||||
|
||||
// Check if we have imagick
|
||||
if (!class_exists('Imagick')) {
|
||||
throw Exceptions::Forbidden('Imagick extension is not available');
|
||||
|
|
Loading…
Reference in New Issue