Changeset 1322 in ExiteCMS for trunk/administration/modules.php


Ignore:
Timestamp:
02/28/08 00:27:46 (4 years ago)
Author:
hverton
Message:

conversion of module version numbers so they can be compared numerically
fixed typo in forum/index.php that caused a query to crash

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/administration/modules.php

    r1281 r1322  
    480480                    $this_module['id'] = $data['mod_id']; 
    481481                    $this_module['version'] = $data['mod_version']; 
    482                     if ($mod_version > $data['mod_version']) { 
     482                    // convert the versions to a number 
     483                    $new = explode(".", $mod_version); 
     484                    while (count($new) < 4) { array_unshift($new, 0); } 
     485                    $new = 1 * $new[3] + 100 * $new[2] + 10000 * $new[1] + 1000000 * $new[0];  
     486                    $cur = explode(".", $data['mod_version']); 
     487                    while (count($cur) < 4) { array_unshift($cur, 0); } 
     488                    $cur = 1 * $cur[3] + 100 * $cur[2] + 10000 * $cur[1] + 1000000 * $cur[0];  
     489                    // now compare the numeric version numbers 
     490                    if ($new > $cur) { 
    483491                        if ($filter && $filter != 2) continue; 
    484492                        $this_module['status'] = 2; 
Note: See TracChangeset for help on using the changeset viewer.