From 02abf6117b816d15c75d5aca2d17dd10328bba01 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Sun, 19 Feb 2012 17:13:00 +0000 Subject: [PATCH] order --- classes/class-wc-order.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classes/class-wc-order.php b/classes/class-wc-order.php index e526310a7b8..747c75c7762 100644 --- a/classes/class-wc-order.php +++ b/classes/class-wc-order.php @@ -139,6 +139,11 @@ class WC_Order { $this->status = (isset($terms[0])) ? $terms[0] : 'pending'; } + function key_is_valid( $key ) { + if ($key==$this->order_key) return true; + return false; + } + function get_formatted_billing_address() { if (!$this->formatted_billing_address) : global $woocommerce; @@ -635,7 +640,7 @@ class WC_Order { $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID'); $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] ); - $commentdata['comment_agent'] = substr($_SERVER['HTTP_USER_AGENT'], 0, 254); + if (isset($_SERVER['HTTP_USER_AGENT'])) $commentdata['comment_agent'] = substr($_SERVER['HTTP_USER_AGENT'], 0, 254); $commentdata['comment_date'] = current_time('mysql'); $commentdata['comment_date_gmt'] = current_time('mysql', 1);