Skip to content

Commit

Permalink
Fix #10192: Only show unique version names in selection lists.
Browse files Browse the repository at this point in the history
  • Loading branch information
amyreese committed Mar 30, 2009
1 parent 2ad35dd commit 470f27c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions core/print_api.php
Expand Up @@ -782,6 +782,8 @@ function print_version_option_list( $p_version = '', $p_project_id = null, $p_re
echo '<option value=""></option>';
}

$t_listed = array();

foreach( $versions as $version ) {

# If the current version is obsolete, and current version not equal to $p_version,
Expand All @@ -793,9 +795,13 @@ function print_version_option_list( $p_version = '', $p_project_id = null, $p_re
}

$t_version = string_attribute( $version['version'] );
echo "<option value=\"$t_version\"";
check_selected( $p_version, $t_version );
echo '>', string_shorten( $t_version ), '</option>';

if ( !in_array( $t_version, $t_listed ) ) {
$t_listed[] = $t_version;
echo "<option value=\"$t_version\"";
check_selected( $p_version, $t_version );
echo '>', string_shorten( $t_version ), '</option>';
}
}
}

Expand Down

0 comments on commit 470f27c

Please sign in to comment.