Skip to content

Commit

Permalink
fix(webhooks): check if endpoint exists (#2276)
Browse files Browse the repository at this point in the history
  • Loading branch information
adekbadek authored Feb 14, 2023
1 parent 7756d3c commit 5a95e2c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions includes/data-events/class-webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,12 @@ public static function process_request( $request_id ) {
if ( ! $endpoint ) {
self::add_request_error( $request_id, __( 'Endpoint not found.', 'newspack' ) );
self::kill_request( $request_id );
return;
}
if ( $endpoint['disabled'] ) {
self::add_request_error( $request_id, __( 'Endpoint is disabled.', 'newspack' ) );
self::kill_request( $request_id );
return;
}

$errors = self::get_request_errors( $request_id );
Expand Down

0 comments on commit 5a95e2c

Please sign in to comment.