Skip to content

Commit

Permalink
bug 2730: multi size not deleted when physical directory deleted
Browse files Browse the repository at this point in the history
git-svn-id: http://piwigo.org/svn/trunk@17650 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rvelices committed Aug 27, 2012
1 parent a6c33e9 commit 62452b9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion admin/site_update.php
Expand Up @@ -303,19 +303,31 @@
}

// to delete categories
$to_delete = array();
$to_delete = array(); $to_delete_derivative_dirs = array();
foreach (array_diff(array_keys($db_fulldirs), $fs_fulldirs) as $fulldir)
{
array_push($to_delete, $db_fulldirs[$fulldir]);
unset($db_fulldirs[$fulldir]);
array_push($infos, array('path' => $fulldir,
'info' => l10n('deleted')));
if (substr_compare($fulldir, '../', 0, 3)==0)
{
$fulldir = substr($fulldir, 3);
}
$to_delete_derivative_dirs[] = PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR.$fulldir;
}
if (count($to_delete) > 0)
{
if (!$simulate)
{
delete_categories($to_delete);
foreach($to_delete_derivative_dirs as $to_delete_dir)
{
if (is_dir($to_delete_dir))
{
clear_derivative_cache_rec($to_delete_dir, '#.+#');
}
}
}
$counts['del_categories'] = count($to_delete);
}
Expand Down

0 comments on commit 62452b9

Please sign in to comment.