Skip to content

Commit

Permalink
REST: Add validation that required info is supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
vboctor committed Apr 23, 2017
1 parent 91d8faf commit fc92d38
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api/soap/mc_issue_api.php
Expand Up @@ -643,6 +643,18 @@ function mc_issue_add( $p_username, $p_password, $p_issue ) {
$p_issue = ApiObjectFactory::objectToArray( $p_issue );
}

if( !isset( $p_issue['summary'] ) ) {
return ApiObjectFactory::faultBadRequest( 'Summary not specified' );
}

if( !isset( $p_issue['description'] ) ) {
return ApiObjectFactory::faultBadRequest( 'Description not specified' );
}

if( !isset( $p_issue['project'] ) ) {
return ApiObjectFactory::faultBadRequest( 'Project not specified' );
}

$t_project = $p_issue['project'];

$t_project_id = mci_get_project_id( $t_project );
Expand Down

0 comments on commit fc92d38

Please sign in to comment.