Changeset 207

Show
Ignore:
Timestamp:
23/02/07 14:27:40 (2 years ago)
Author:
dez
Message:

Corrects the calculation of the blog version number

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • miscfunctions.lib.php

    r205 r207  
    3939} 
    4040 
    41 $revision = "unknown"; 
     41$revision = "0"; 
    4242function startElement($parser, $name, $attrs) 
    4343{ 
    4444        global $revision; 
    45         if($name=="ENTRY" && $attrs['NAME']=="") { 
    46                 $revision = $attrs['REVISION']; 
    47         } 
     45        if ($attrs['REVISION']>$revision) $revision = $attrs['REVISION']; 
    4846} 
    4947 
     
    5856                return "unknown - couldn't open SVN XML file."; 
    5957        } 
    60         while(($data = fread($fp, 1024)) && $revision=="unknown") { 
     58        while(($data = fread($fp, 1024))) { 
    6159                if (!xml_parse($xml_parser, $data, feof($fp))) { 
    6260                        return "unknown - couldn't parse SVN XML file"; 
     
    6462        } 
    6563        xml_parser_free($xml_parser); 
    66         return $revision; 
     64        if ($revision=="0") return "unknown"; 
     65        else return $revision; 
    6766} 
    6867