Skip to content

Commit

Permalink
merge r3656 from branch 2.0 to trunk
Browse files Browse the repository at this point in the history
feature 953: avoid fatal error when delete a photo (added with pwg.images.add
API) and the file doesn't not exist on the filesystem.

git-svn-id: http://piwigo.org/svn/trunk@3657 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Jul 21, 2009
1 parent 537b843 commit e36de08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion admin/include/functions.php
Expand Up @@ -171,7 +171,7 @@ function delete_elements($ids, $physical_deletion=false)

foreach (array($file_path, $thumbnail_path, $high_path) as $path)
{
if (isset($path) and !unlink($path))
if (isset($path) and is_file($path) and !unlink($path))
{
die('"'.$path.'" cannot be removed');
}
Expand Down

0 comments on commit e36de08

Please sign in to comment.