From: <vb...@us...> - 2002-05-31 15:03:20
|
Update of /cvsroot/mantisbt/mantisbt In directory usw-pr-cvs1:/tmp/cvs-serv27717 Modified Files: core_version_API.php manage_proj_ver_add.php Log Message: Implemented a fix for #2034 where it was possible to add the same version name multiple times to the same project. This was due to a bug in is_duplicate_version(). Index: core_version_API.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core_version_API.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- core_version_API.php 26 May 2002 15:54:25 -0000 1.5 +++ core_version_API.php 31 May 2002 15:03:17 -0000 1.6 @@ -15,13 +15,15 @@ $c_project_id = (integer)$p_project_id; $c_version = addslashes($p_version); - $c_date_order = addslashes($p_date_order); $query = "SELECT COUNT(*) FROM $g_mantis_project_version_table WHERE project_id='$c_project_id' AND - version='$c_version' AND - date_order='$c_date_order'"; + version='$c_version'"; + if ( strcmp($p_date_order, '0') != 0) { + $c_date_order = addslashes($p_date_order); + $query = $query . " AND date_order='$c_date_order'"; + } $result = db_query( $query ); $version_count = db_result( $result, 0, 0 ); if ( $version_count > 0 ) { Index: manage_proj_ver_add.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/manage_proj_ver_add.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- manage_proj_ver_add.php 27 May 2002 23:28:57 -0000 1.6 +++ manage_proj_ver_add.php 31 May 2002 15:03:17 -0000 1.7 @@ -36,7 +36,7 @@ if ( $result ) { # SUCCESS PRINT "$s_operation_successful<p>"; } else if ( is_duplicate_version( $f_project_id, $f_version )) { - PRINT $MANTIS_ERROR[ERROR_DUPLICATE_VERSION]; + PRINT $MANTIS_ERROR[ERROR_DUPLICATE_VERSION] . '<p>'; } else { # FAILURE print_sql_error( $query ); } |