diff --git a/client-mu-plugins/goodbids/src/classes/Plugins/WooCommerce/Emails/Email.php b/client-mu-plugins/goodbids/src/classes/Plugins/WooCommerce/Emails/Email.php index 1beffee0..fa5f8b80 100644 --- a/client-mu-plugins/goodbids/src/classes/Plugins/WooCommerce/Emails/Email.php +++ b/client-mu-plugins/goodbids/src/classes/Plugins/WooCommerce/Emails/Email.php @@ -317,7 +317,7 @@ public function trigger( mixed $object = null, ?int $user_id = null ): void { // Woohoo, send the email! $this->send( $this->get_recipient(), - goodbids()->utilities->sanitize_email_subject( $this->get_subject() ), + goodbids()->utilities->sanitize_email_special_chars( $this->get_subject() ), $this->get_content(), $this->get_headers(), $this->get_attachments() @@ -442,7 +442,7 @@ private function default_placeholders(): void { $auction_title = $auction?->get_title() ?: ''; $this->add_placeholder( '{auction.url}', $auction?->get_url() ); $this->add_placeholder( '{auction.admin_url}', get_edit_post_link( $auction?->get_id() ) ); - $this->add_placeholder( '{auction.title}', htmlspecialchars( $auction_title ) ); + $this->add_placeholder( '{auction.title}', goodbids()->utilities->sanitize_email_special_chars( $auction_title ) ); $this->add_placeholder( '{auction.start_date_time}', $auction?->get_start_date_time( $datetime_format ) ); $this->add_placeholder( '{auction.end_date_time}', $auction?->get_end_date_time( $datetime_format ) ); diff --git a/client-mu-plugins/goodbids/src/classes/Utilities/Utilities.php b/client-mu-plugins/goodbids/src/classes/Utilities/Utilities.php index 05a7220e..6acfe0f2 100644 --- a/client-mu-plugins/goodbids/src/classes/Utilities/Utilities.php +++ b/client-mu-plugins/goodbids/src/classes/Utilities/Utilities.php @@ -244,16 +244,16 @@ public function network_get_current_blog_id(): int { } /** - * Sanitize Special Characters from Email Subject + * Sanitize Special Characters in Emails * * @since 1.0.1 * - * @param string $subject + * @param string $string * * @return string */ - public function sanitize_email_subject( string $subject ): string { - $subject = htmlspecialchars_decode( $subject ); - return html_entity_decode( $subject ); + public function sanitize_email_special_chars( string $string ): string { + $string = htmlspecialchars_decode( $string ); + return html_entity_decode( $string ); } }