Only use server if set. Closes #1970.
This commit is contained in:
parent
a697ffbeb6
commit
0f36cc69f2
|
@ -1135,9 +1135,13 @@ class WC_Order {
|
||||||
|
|
||||||
$is_customer_note = intval( $is_customer_note );
|
$is_customer_note = intval( $is_customer_note );
|
||||||
|
|
||||||
|
if ( isset( $_SERVER['HTTP_HOST'] ) )
|
||||||
|
$comment_author_email = sanitize_email( strtolower( __( 'WooCommerce', 'woocommerce' ) ) . '@' . str_replace( 'www.', '', $_SERVER['HTTP_HOST'] ) );
|
||||||
|
else
|
||||||
|
$comment_author_email = sanitize_email( strtolower( __( 'WooCommerce', 'woocommerce' ) ) . '@noreply.com';
|
||||||
|
|
||||||
$comment_post_ID = $this->id;
|
$comment_post_ID = $this->id;
|
||||||
$comment_author = __( 'WooCommerce', 'woocommerce' );
|
$comment_author = __( 'WooCommerce', 'woocommerce' );
|
||||||
$comment_author_email = sanitize_email( strtolower( __( 'WooCommerce', 'woocommerce' ) ) . '@' . str_replace( 'www.', '', $_SERVER['HTTP_HOST'] ) );
|
|
||||||
$comment_author_url = '';
|
$comment_author_url = '';
|
||||||
$comment_content = $note;
|
$comment_content = $note;
|
||||||
$comment_agent = 'WooCommerce';
|
$comment_agent = 'WooCommerce';
|
||||||
|
|
Loading…
Reference in New Issue