From c8b0ff974abbb069df6762156f6931bb7e069f1b Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Mon, 11 Jun 2007 00:25:50 +0000 Subject: [PATCH] Remove "CVS" version from the array of Wine versions we present to the user. It was a dumb idea to have a CVS version anyway since all CVS versions appear the same. --- include/util.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/include/util.php b/include/util.php index 1d01d71..d3ad00f 100644 --- a/include/util.php +++ b/include/util.php @@ -168,29 +168,28 @@ function make_bugzilla_version_list($varname, $cvalue) // and we can't use 'order by' since we have no column // to order by, but the entries should come out in the // order they were added - // - Trim the list, we don't want every version of wine ever released - // - Add 'CVS' explicitly since we trim it out + // - Trim the list, we don't want every version of wine ever released and + // we don't want the "CVS" version included since we can never figure out + // what version of Wine any given "CVS" version is // // TODO: if we ever get a reasonable way to order the list replace this code // with that $aVersions = array(); - while(list($value) = mysql_fetch_row($hResult)) + while(list($sValue) = mysql_fetch_row($hResult)) { - // exclude unspecified versions - if($value != "unspecified") - $aVersions[] = $value; + // exclude unspecified versions and the "CVS" version + if(($sValue != "unspecified") && ($sValue != "CVS")) + $aVersions[] = $sValue; } - // now reverse the array order + // now reverse the array order since the oldest + // versions were added first $aVersions = array_reverse($aVersions); // now trim off all but the last X versions $iVersionsToKeep = 6; $aVersions = array_slice($aVersions, 0, $iVersionsToKeep); - // explicitly add 'CVS' since we are eliminating that above - $aVersions[] = "CVS"; - // DONE TRIMMING VERSIONS /////////////////////////