Skip to content

Commit

Permalink
Throw error when attempting to create invalid tag
Browse files Browse the repository at this point in the history
Fixes #26074
  • Loading branch information
dregad committed Aug 25, 2019
1 parent 6b774ea commit c6727a8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tag_create.php
Expand Up @@ -31,6 +31,7 @@

require_once( 'core.php' );
require_api( 'authentication_api.php' );
require_api( 'error_api.php' );
require_api( 'form_api.php' );
require_api( 'gpc_api.php' );
require_api( 'print_api.php' );
Expand All @@ -46,8 +47,13 @@
if( !is_null( $f_tag_name ) ) {
$t_tags = tag_parse_string( $f_tag_name );
foreach ( $t_tags as $t_tag_row ) {
if( -1 == $t_tag_row['id'] ) {
tag_create( $t_tag_row['name'], $t_tag_user, $f_tag_description );
switch( $t_tag_row['id'] ) {
case -1:
tag_create( $t_tag_row['name'], $t_tag_user, $f_tag_description );
break;
case -2:
error_parameters( $t_tag_row['name'] );
trigger_error( ERROR_TAG_NAME_INVALID, ERROR );
}
}
}
Expand Down

0 comments on commit c6727a8

Please sign in to comment.