mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-10 10:42:59 +02:00
fixes #529, protect delete_orphans against CSRF
This commit is contained in:
@@ -66,6 +66,8 @@ DELETE FROM '.CADDIE_TABLE.'
|
||||
|
||||
if ('delete_orphans' == $_GET['action'])
|
||||
{
|
||||
check_pwg_token();
|
||||
|
||||
$deleted_count = delete_elements(get_orphans(), true);
|
||||
|
||||
if ($deleted_count > 0)
|
||||
|
||||
@@ -345,7 +345,7 @@ var sliders = {
|
||||
{/foreach}
|
||||
</select>
|
||||
<a id="empty_caddie" href="admin.php?page=batch_manager&action=empty_caddie" style="{if !isset($filter.prefilter) or $filter.prefilter ne 'caddie'}display:none{/if}">{'Empty caddie'|translate}</a>
|
||||
<a id="delete_orphans" href="admin.php?page=batch_manager&action=delete_orphans" style="{if !isset($filter.prefilter) or $filter.prefilter ne 'no_album'}display:none{/if}">{'Delete %d orphan photos'|translate:$NB_ORPHANS}</a>
|
||||
<a id="delete_orphans" href="admin.php?page=batch_manager&action=delete_orphans&pwg_token={$PWG_TOKEN}" style="{if !isset($filter.prefilter) or $filter.prefilter ne 'no_album'}display:none{/if}">{'Delete %d orphan photos'|translate:$NB_ORPHANS}</a>
|
||||
|
||||
<span id="duplicates_options" style="{if !isset($filter.prefilter) or $filter.prefilter ne 'duplicates'}display:none{/if}">
|
||||
{'based on'|translate}
|
||||
|
||||
Reference in New Issue
Block a user