Skip to content

Commit

Permalink
Refactor validation for brevity
Browse files Browse the repository at this point in the history
  • Loading branch information
hanifn committed Jun 24, 2024
1 parent a540e18 commit 157ec5c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions modules/notifications/notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -1416,11 +1416,7 @@ public function settings_validate( $new_options ) {
}

// White list validation for the 'slack_webhook_url' option
if ( ! isset( $new_options['webhook_url'] ) ) {
$new_options['webhook_url'] = '';
}

if ( esc_url_raw( $new_options['webhook_url'] ) !== $new_options['webhook_url'] ) {
if ( ! isset( $new_options['webhook_url'] ) || esc_url_raw( $new_options['webhook_url'] ) !== $new_options['webhook_url'] ) {
$new_options['webhook_url'] = '';
} else {
$new_options['webhook_url'] = esc_url_raw( $new_options['webhook_url'] );
Expand Down

0 comments on commit 157ec5c

Please sign in to comment.