Add missing # before order numbers and escape properly

This commit is contained in:
Gerhard Potgieter 2018-09-12 12:24:27 +02:00
parent d7cb15c8f8
commit 5f7b833844
5 changed files with 12 additions and 16 deletions

View File

@ -70,9 +70,9 @@ if ( ! class_exists( 'WC_Email_Customer_Refunded_Order', false ) ) :
*/
public function get_default_subject( $partial = false ) {
if ( $partial ) {
return __( 'Your {site_title} order {order_number} has been partially refunded', 'woocommerce' );
return __( 'Your {site_title} order #{order_number} has been partially refunded', 'woocommerce' );
} else {
return __( 'Your {site_title} order {order_number} has been refunded', 'woocommerce' );
return __( 'Your {site_title} order #{order_number} has been refunded', 'woocommerce' );
}
}

View File

@ -66,7 +66,7 @@ if ( ! class_exists( 'WC_Email_Failed_Order', false ) ) :
* @return string
*/
public function get_default_heading() {
return __( 'Order Failed: {order_number}', 'woocommerce' );
return __( 'Order Failed: #{order_number}', 'woocommerce' );
}
/**

View File

@ -49,7 +49,7 @@ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text,
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
?>
<p>
<?php esc_html_e( 'Hopefully theyll be back. Read more about <a href="https://docs.woocommerce.com/document/managing-orders/#section-10">troubleshooting failed payments</a>.', 'woocommerce' ); ?>
<?php echo wp_kses_post( __( 'Hopefully theyll be back. Read more about <a href="https://docs.woocommerce.com/document/managing-orders/#section-10">troubleshooting failed payments</a>.', 'woocommerce' ) ); ?>
</p>
<?php

View File

@ -25,9 +25,9 @@ if ( ! defined( 'ABSPATH' ) ) {
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<?php /* translators: %s: Customer first name */ ?>
<p><?php printf( __( 'Hi %s,', 'woocommerce' ), $order->get_billing_first_name() ); ?></p><?php // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?>
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); ?></p>
<?php /* translators: %s: Site title */ ?>
<p><?php printf( __( 'Your %s order has been marked complete on our side. We hope you enjoy it!', 'woocommerce' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ); ?></p><?php // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?>
<p><?php printf( esc_html__( 'Your %s order has been marked complete on our side.', 'woocommerce' ), esc_html( wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ) ); ?></p>
<?php
/*
@ -51,7 +51,7 @@ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_
?>
<p>
<?php _e( 'Thanks for shopping with us.', 'woocommerce' ); // phpcs:ignore WordPress.XSS.EscapeOutput ?>
<?php esc_html_e( 'Thanks for shopping with us.', 'woocommerce' ); ?>
</p>
<?php

View File

@ -19,12 +19,12 @@ if ( ! defined( 'ABSPATH' ) ) {
exit;
}
echo '= ' . $email_heading . " =\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
echo '= ' . esc_html( $email_heading ) . " =\n\n";
/* translators: %s: Customer first name */
printf( __( 'Hi %s,', 'woocommerce' ), $order->get_billing_first_name() ) . "\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n";
/* translators: %s: Site title */
printf( __( 'Your %s order has been marked complete on our side. We hope you enjoy it!', 'woocommerce' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ) . "\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
echo sprintf( esc_html__( 'Your %s order has been marked complete on our side.', 'woocommerce' ), esc_html( wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ) ) . "\n\n";
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
@ -49,12 +49,8 @@ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text,
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
?>
<p>
<?php _e( 'Thanks for shopping with us.', 'woocommerce' ); // phpcs:ignore WordPress.XSS.EscapeOutput ?>
</p>
<?php
echo esc_html__( 'Thanks for shopping with us.', 'woocommerce' ) . "\n\n";
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
echo esc_html( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped