Only use server if set. Closes #1970.

This commit is contained in:
Mike Jolley 2012-12-11 17:05:31 +00:00
parent a697ffbeb6
commit 0f36cc69f2
1 changed files with 5 additions and 1 deletions

View File

@ -1135,9 +1135,13 @@ class WC_Order {
$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_author = __( 'WooCommerce', 'woocommerce' );
$comment_author_email = sanitize_email( strtolower( __( 'WooCommerce', 'woocommerce' ) ) . '@' . str_replace( 'www.', '', $_SERVER['HTTP_HOST'] ) );
$comment_author_url = '';
$comment_content = $note;
$comment_agent = 'WooCommerce';