Skip to content

Commit

Permalink
Add error message for wildcard case
Browse files Browse the repository at this point in the history
Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com>
  • Loading branch information
mrrobot47 committed Dec 12, 2018
1 parent aab94a1 commit 5428676
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/helper/class-ee-site.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,17 @@ public function update( $args, $assoc_args ) {
*/
protected function update_ssl( $assoc_args ) {

$ssl = get_flag_value( $assoc_args, 'ssl', false );
$wildcard = get_flag_value( $assoc_args, 'wildcard', false );
$ssl = get_flag_value( $assoc_args, 'ssl', false );
$wildcard = get_flag_value( $assoc_args, 'wildcard', false );
$show_error = $this->site_data->site_ssl ? true : false;
$wildcard_error = ( ! $this->site_data->site_ssl_wildcard && $wildcard ) ? true : false;

if ( $this->site_data->site_ssl ) {
EE::error( 'Site ' . $this->site_data->site_url . ' already contains SSL.' );
$error = $wildcard_error ? 'Update from normal ssl to wildcard is not supported yet.' : 'Site ' . $this->site_data->site_url . ' already contains SSL.';

if ( $show_error ) {
EE::error( $error );
}

EE::log( 'Starting ssl update for: ' . $this->site_data->site_url );
try {
$this->site_data->site_ssl = $ssl;
Expand Down

0 comments on commit 5428676

Please # to comment.