mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-19 01:43:44 +03:00
Harden endpoint against junk inputs.
This avoids a PHP Notice when the `pledge_id` is invalid, or not a valid pledge.
This commit is contained in:
parent
574ab7fd4e
commit
44e9daccd9
|
@ -93,7 +93,7 @@ function send_manage_email_handler() {
|
|||
|
||||
$pledge_id = filter_input( INPUT_POST, 'pledge_id', FILTER_VALIDATE_INT );
|
||||
$email = strtolower( filter_input( INPUT_POST, 'email', FILTER_VALIDATE_EMAIL ) );
|
||||
$valid_email = strtolower( get_post( $pledge_id )->{ META_PREFIX . 'org-pledge-email' } );
|
||||
$valid_email = strtolower( get_post( $pledge_id )->{ META_PREFIX . 'org-pledge-email' } ?? '' );
|
||||
|
||||
if ( $valid_email && $valid_email === $email ) {
|
||||
$message_sent = Email\send_manage_pledge_link( $pledge_id );
|
||||
|
|
Loading…
Reference in a new issue