Dotclear


Ignore:
Timestamp:
11/19/12 12:34:31 (13 years ago)
Author:
JcDenis
Branch:
default
Message:

Enhance mass posts actions by reducing SQL queries, addresses #943

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.utils.php

    r270 r1030  
    4949          return $user_id; 
    5050     } 
     51      
     52     /** 
     53     Cleanup a list of IDs 
     54      
     55     @param    ids            <b>mixed</b>   ID(s) 
     56     @return   <b>array</b> 
     57     */ 
     58     public static function cleanIds($ids) 
     59     { 
     60          $clean_ids = array(); 
     61           
     62          if (!is_array($ids)) { 
     63               $ids = array($ids); 
     64          } 
     65           
     66          foreach($ids as $id) 
     67          { 
     68               $id = abs((integer) $id); 
     69                
     70               if (!empty($id)) { 
     71                    $clean_ids[] = $id; 
     72               } 
     73          } 
     74          return $clean_ids; 
     75     } 
    5176} 
    5277 
Note: See TracChangeset for help on using the changeset viewer.

Sites map