From: <nuc...@us...> - 2008-09-28 13:53:47
|
Revision: 5602 http://mantisbt.svn.sourceforge.net/mantisbt/?rev=5602&view=rev Author: nuclear_eclipse Date: 2008-09-28 13:53:37 +0000 (Sun, 28 Sep 2008) Log Message: ----------- Move bug_create() validation to bug_report.php so that form security tokens work right. Modified Paths: -------------- trunk/mantisbt/bug_report.php trunk/mantisbt/core/bug_api.php Modified: trunk/mantisbt/bug_report.php =================================================================== --- trunk/mantisbt/bug_report.php 2008-09-27 23:30:49 UTC (rev 5601) +++ trunk/mantisbt/bug_report.php 2008-09-28 13:53:37 UTC (rev 5602) @@ -94,6 +94,24 @@ } } + # Summary cannot be blank + if ( is_blank( $t_bug_data->summary ) ) { + error_parameters( lang_get( 'summary' ) ); + trigger_error( ERROR_EMPTY_FIELD, ERROR ); + } + + # Description cannot be blank + if ( is_blank( $t_bug_data->description ) ) { + error_parameters( lang_get( 'description' ) ); + trigger_error( ERROR_EMPTY_FIELD, ERROR ); + } + + # Make sure a category is set + if ( 0 == $t_bug_data->category_id && !config_get( 'allow_no_category' ) ) { + error_parameters( lang_get( 'category' ) ); + trigger_error( ERROR_EMPTY_FIELD, ERROR ); + } + helper_call_custom_function( 'issue_create_validate', array( $t_bug_data ) ); # Validate the custom fields before adding the bug. Modified: trunk/mantisbt/core/bug_api.php =================================================================== --- trunk/mantisbt/core/bug_api.php 2008-09-27 23:30:49 UTC (rev 5601) +++ trunk/mantisbt/core/bug_api.php 2008-09-28 13:53:37 UTC (rev 5602) @@ -480,24 +480,6 @@ $c_sponsorship_total = 0; $c_sticky = 0; - # Summary cannot be blank - if ( is_blank( $c_summary ) ) { - error_parameters( lang_get( 'summary' ) ); - trigger_error( ERROR_EMPTY_FIELD, ERROR ); - } - - # Description cannot be blank - if ( is_blank( $c_description ) ) { - error_parameters( lang_get( 'description' ) ); - trigger_error( ERROR_EMPTY_FIELD, ERROR ); - } - - # Make sure a category is set - if ( 0 == $c_category_id && !config_get( 'allow_no_category' ) ) { - error_parameters( lang_get( 'category' ) ); - trigger_error( ERROR_EMPTY_FIELD, ERROR ); - } - # Only set target_version if user has access to do so if ( access_has_project_level( config_get( 'roadmap_update_threshold' ) ) ) { $c_target_version = $p_bug_data->target_version; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |