Index: comment.php
===================================================================
--- comment.php	(revisión: 32)
+++ comment.php	(copia de trabajo)
@@ -384,7 +384,20 @@
 	$commentdata['user_ID']         = (int) $commentdata['user_ID'];
 
 	$commentdata['comment_author_IP'] = preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] );
-	$commentdata['comment_agent']     = $_SERVER['HTTP_USER_AGENT'];
+	if ($commentdata['comment_author_IP'] == "127.0.0.1") {
+		foreach ( array(
+			"HTTP_CLIENT_IP",
+			"HTTP_X_FORWARDED_FOR",
+			"HTTP_X_FORWARDED",
+			"HTTP_FORWARDED_FOR",
+			"HTTP_FORWARDED",
+			"REMOTE_ADDR") as $addrtype ) {
+				if (!isset($_SERVER[$addrtype])) { continue; }
+				$commentdata['comment_author_IP'] = preg_replace( '/[^0-9., ]/', '',$_SERVER[$addrtype] );
+				if ($commentdata['comment_author_IP']) break;
+			}
+	}
+	$commentdata['comment_agent'] = $_SERVER['HTTP_USER_AGENT'];
 
 	$commentdata['comment_date']     = current_time('mysql');
 	$commentdata['comment_date_gmt'] = current_time('mysql', 1);

