diff --git a/result.php b/result.php index addaaf8..9ac2ac6 100644 --- a/result.php +++ b/result.php @@ -27,6 +27,11 @@ if ( !empty( $_REQUEST['keyword'] ) && yourls_keyword_is_reserved( $_REQUEST['ke display_error( sprintf( yourls__( 'The keyword %1$s is reserved.'), '' . $_REQUEST['keyword'] . '' ) ); } +// Check if the keyword is taken +if ( !empty( $_REQUEST['keyword'] ) && yourls_keyword_is_taken( $_REQUEST['keyword'] ) ) { + display_error( sprintf( yourls__( 'The keyword %1$s is taken.'), '' . $_REQUEST['keyword'] . '' ) ); +} + // Check what CAPTCHA method was used $antispam_method = $_REQUEST['antispam_method']; @@ -74,6 +79,11 @@ $message = isset( $return['message'] ) ? $return['message'] : ''; $title = isset( $return['title'] ) ? $return['title'] : ''; $status = isset( $return['status'] ) ? $return['status'] : ''; +// Check for all other errors +if( empty( $shorturl ) ) { + display_error( yourls__( 'The URL could not be shortened.', 'isq_translation' ) ); +} + // URL encoded links used in the social sharing buttons $encoded_shorturl = urlencode($shorturl); $encoded_title = urlencode($title);