Changeset 26999 for branches/2.6/admin
- Timestamp:
- Jan 27, 2014, 7:05:04 PM (10 years ago)
- Location:
- branches/2.6/admin
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.6/admin/history.php
r26649 r26999 340 340 name, url_name 341 341 FROM '.TAGS_TABLE; 342 343 global $name_of_tag; // used for preg_replace 342 344 $name_of_tag = array(); 343 345 $result = pwg_query($query); … … 400 402 if (isset($line['tag_ids'])) 401 403 { 402 $tags_string = preg_replace (403 '/(\d+)/ e',404 'isset($name_of_tag["$1"]) ? $name_of_tag["$1"] : "$1"',404 $tags_string = preg_replace_callback( 405 '/(\d+)/', 406 create_function('$m', 'return isset($name_of_tag[$m[1]]) ? $name_of_tag[$m[1]] : $m[1];'), 405 407 str_replace( 406 408 ',', … … 542 544 ) 543 545 ); 546 547 unset($name_of_tag); 544 548 } 545 549 -
branches/2.6/admin/include/functions.php
r26921 r26999 577 577 ORDER BY id_uppercat,rank,name'; 578 578 579 global $cat_map; // used in preg_replace callback 579 580 $cat_map = array(); 580 581 … … 603 604 $datas = array(); 604 605 606 $cat_map_callback = create_function('$m', 'global $cat_map; return $cat_map[$m[1]]["rank"];'); 607 605 608 foreach( $cat_map as $id=>$cat ) 606 609 { 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 612 616 if ( $cat['rank_changed'] 613 617 or $new_global_rank!=$cat['global_rank'] … … 621 625 } 622 626 } 627 628 unset($cat_map); 623 629 624 630 mass_updates( -
branches/2.6/admin/include/languages.class.php
r26461 r26999 403 403 * Sort functions 404 404 */ 405 function language_version_compare($a, $b)406 {407 $pattern = array('/([a-z])/ei', '/\.+/', '/\.\Z|\A\./');408 $replacement = array( "'.'.intval('\\1', 36).'.'", '.', '');409 410 $array = preg_replace($pattern, $replacement, array($a, $b));411 412 return version_compare($array[0], $array[1], '>=');413 }414 415 405 function extension_name_compare($a, $b) 416 406 { -
branches/2.6/admin/include/plugins.class.php
r26461 r26999 615 615 * Sort functions 616 616 */ 617 function plugin_version_compare($a, $b)618 {619 if (strtolower($a) == 'auto') return false;620 621 $array = preg_replace(622 array('/\.+/', '/\.\Z|\A\./'),623 array('.', ''),624 array($a, $b)625 );626 627 $array = preg_replace_callback(628 '/([a-z])/i',629 create_function('$m', 'return intval($m[1], 36);'),630 $array631 );632 633 return version_compare($array[0], $array[1], '>=');634 }635 636 617 function extension_revision_compare($a, $b) 637 618 { -
branches/2.6/admin/include/themes.class.php
r26461 r26999 690 690 * Sort functions 691 691 */ 692 function theme_version_compare($a, $b)693 {694 $pattern = array('/([a-z])/ei', '/\.+/', '/\.\Z|\A\./');695 $replacement = array( "'.'.intval('\\1', 36).'.'", '.', '');696 697 $array = preg_replace($pattern, $replacement, array($a, $b));698 699 return version_compare($array[0], $array[1], '>=');700 }701 702 692 function extension_revision_compare($a, $b) 703 693 {
Note: See TracChangeset
for help on using the changeset viewer.