diff options
author | Adrian Lang <lang@cosmocode.de> | 2009-12-10 11:43:20 +0100 |
---|---|---|
committer | Adrian Lang <lang@cosmocode.de> | 2009-12-10 11:43:20 +0100 |
commit | afc5e13aeb41bba9cdd2e3698f92517ac78e451f (patch) | |
tree | 1d6f0815fc8817d7d7e15502dbe961c589b25ae7 /inc | |
parent | 6c6ee18ca085273a1bc16293583692c74ce47ef6 (diff) | |
download | rpg-afc5e13aeb41bba9cdd2e3698f92517ac78e451f.tar.gz rpg-afc5e13aeb41bba9cdd2e3698f92517ac78e451f.tar.bz2 |
Grab version from darcs correctly and simpler
darcs-hash:20091210104320-e4919-3178a4f01fc1e1720ad86716552f4deaa52dc236.gz
Diffstat (limited to 'inc')
-rw-r--r-- | inc/infoutils.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/inc/infoutils.php b/inc/infoutils.php index bf8554692..b43dd40be 100644 --- a/inc/infoutils.php +++ b/inc/infoutils.php @@ -74,10 +74,10 @@ function getVersionData(){ fseek($fh,$seek); $chunk = fread($fh,2000); fclose($fh); - $inv = preg_grep('#\*\*\d{14}[\]$]#',explode("\n",$chunk)); - $cur = array_pop($inv); - preg_match('#\*\*(\d{4})(\d{2})(\d{2})#',$cur,$matches); - $version['date'] = $matches[1].'-'.$matches[2].'-'.$matches[3]; + + preg_match_all('#\*\*(\d{4})(\d{2})(\d{2})\d{6}(?:\]|$)#m', $chunk, $matches, + PREG_SET_ORDER); + $version['date'] = implode('-', array_slice(array_pop($matches), 1)); $version['type'] = 'Darcs'; return $version; }else{ |