From 5a38c9565c460872ad43d2fe0ae5f3b7e6bf1d1d Mon Sep 17 00:00:00 2001
From: dooug <dooug@417693.no-reply.drupal.org>
Date: Tue, 22 Jan 2013 13:00:57 -0500
Subject: [PATCH] Issue #1380626 by dooug: Ensure comment_save() does not
 overwrite hostname if already set.

---
 modules/comment/comment.module |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 46115be..c66777a 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -1567,7 +1567,9 @@ function comment_save($comment) {
 
       // Add the values which aren't passed into the function.
       $comment->thread = $thread;
-      $comment->hostname = ip_address();
+      if (empty($comment->hostname)){
+        $comment->hostname = ip_address();
+      }
 
       drupal_write_record('comment', $comment);
 
-- 
1.7.9.5

