From 91f943eb5d9c5191e5b9bff299a09d5d93f1ee39 Mon Sep 17 00:00:00 2001 From: Franky Van Liedekerke Date: Wed, 28 Aug 2024 22:20:26 +0200 Subject: [PATCH] check if payment exists --- eme-payments.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/eme-payments.php b/eme-payments.php index 9b7c9887..013a5747 100644 --- a/eme-payments.php +++ b/eme-payments.php @@ -414,11 +414,13 @@ function eme_fs_event_payment_form( $payment_id, $resultcode = 0, $standalone = } $payment = eme_get_payment( $payment_id ); + if (empty($payment)) { + return "
" . __( 'Nothing linked to this payment id', 'events-made-easy' ) . '
'; + } $event = eme_get_event( $payment['related_id'] ); if (empty($event)) { - // evnt has been deleted, but the payment id is still present - $ret_string = "
" . __( "No event found linked to this payment. If you believe you've received this message in error please contact the site owner.", 'events-made-easy' ) . '
'; - return $ret_string; + // event has been deleted, but the payment id is still present + return "
" . __( "No event found linked to this payment. If you believe you've received this message in error please contact the site owner.", 'events-made-easy' ) . '
'; } $check_allowed_to_pay = eme_payment_allowed_to_pay( $payment_id );