Ignore:
Timestamp:
01/27/14 19:05:04 (6 years ago)
Author:
mistic100
Message:

Merged revision(s) 26972, 26998 from trunk:
replace more preg_replace callback
........
remove *_version_compare methods in languages & plugins & themes classes, unused and outdated (preg_replace /e modifier)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/admin/include/functions.php

    r26921 r26999  
    577577  ORDER BY id_uppercat,rank,name'; 
    578578 
     579  global $cat_map; // used in preg_replace callback 
    579580  $cat_map = array(); 
    580581 
     
    603604  $datas = array(); 
    604605 
     606  $cat_map_callback = create_function('$m', 'global $cat_map; return $cat_map[$m[1]]["rank"];'); 
     607 
    605608  foreach( $cat_map as $id=>$cat ) 
    606609  { 
    607     $new_global_rank = preg_replace( 
    608           '/(\d+)/e', 
    609           "\$cat_map['$1']['rank']", 
    610           str_replace(',', '.', $cat['uppercats'] ) 
    611           ); 
     610    $new_global_rank = preg_replace_callback( 
     611      '/(\d+)/', 
     612      $cat_map_callback, 
     613      str_replace(',', '.', $cat['uppercats'] ) 
     614      ); 
     615 
    612616    if ( $cat['rank_changed'] 
    613617      or $new_global_rank!=$cat['global_rank'] 
     
    621625    } 
    622626  } 
     627 
     628  unset($cat_map); 
    623629 
    624630  mass_updates( 
Note: See TracChangeset for help on using the changeset viewer.