Skip to content

Commit

Permalink
only show application url if value appears legitimate
Browse files Browse the repository at this point in the history
  • Loading branch information
pkevan committed Oct 28, 2024
1 parent 0fde6e2 commit 3d9fa45
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public function display_notice( $message, $notice_classes ) {
* @param string $event_city
* @param int $application_post id of post created on WC Central.
*/
public function notify_applicant_application_received( $email_address, $event_city, $application_post ) {
public function notify_applicant_application_received( $email_address, $event_city, $application_post = 0 ) {
//translators: Name of the event. E.g. WordCamp or meetup.
$subject = sprintf( __( "We've received your %s application", 'wordcamporg' ), $this->get_event_label() );
$headers = array(
Expand All @@ -280,13 +280,18 @@ public function notify_applicant_application_received( $email_address, $event_ci
$message .= sprintf(
"---- Internal details for the Community Team ----\n\n
Name: %1\$s\n
Type: %2\$s\n
URL: https://central.wordcamp.org/wp-admin/post.php?post=%3\$d&action=edit",
Type: %2\$s\n",
$this->get_event_label(),
sanitize_text_field( $event_city ),
absint( $application_post ),
);

if ( 0 !== $application_post ) {
$message .= sprintf(
"URL: https://central.wordcamp.org/wp-admin/post.php?post=%3\$d&action=edit",
absint( $application_post )
);
}

wp_mail( $email_address, $subject, $message, $headers );
}

Expand Down

0 comments on commit 3d9fa45

Please sign in to comment.