Ignore:
Timestamp:
Sep 12, 2004, 10:33:56 AM (20 years ago)
Author:
z0rglub
Message:

verification of number of elements to delete in the function and not before
calling function (for delete_elements and delete_categories)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r498 r521  
    194194{
    195195  global $counts;
     196
     197  if (count($ids) == 0)
     198  {
     199    return;
     200  }
    196201 
    197202  // destruction of all the related elements
     
    207212    array_push($element_ids, $row['id']);
    208213  }
    209   if (count($element_ids) > 0)
    210   {
    211     delete_elements($element_ids);
    212   }
     214  delete_elements($element_ids);
    213215
    214216  // destruction of the links between images and this category
     
    269271{
    270272  global $counts;
     273
     274  if (count($ids) == 0)
     275  {
     276    return;
     277  }
    271278 
    272279  // destruction of the comments on the image
Note: See TracChangeset for help on using the changeset viewer.