From 473373dc3708a0f14a0eb569a9f2b07c3e14aaec Mon Sep 17 00:00:00 2001 From: Wytze van der Raay Date: Sun, 28 Apr 2013 15:34:37 +0200 Subject: bug 1171: Avoid warning if no remote IP is available (e.g. inside a cron script) --- includes/mysql.php.sample | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'includes/mysql.php.sample') diff --git a/includes/mysql.php.sample b/includes/mysql.php.sample index eb86401..10185fc 100644 --- a/includes/mysql.php.sample +++ b/includes/mysql.php.sample @@ -64,7 +64,8 @@ fputs($smtp, "DATA\r\n"); $InputBuffer = fgets($smtp, 1024); fputs($smtp, "X-Mailer: CAcert.org Website\r\n"); - fputs($smtp, "X-OriginatingIP: ".$_SERVER["REMOTE_ADDR"]."\r\n"); + if (array_key_exists("REMOTE_ADDR", $_SERVER)) + fputs($smtp, "X-OriginatingIP: ".$_SERVER["REMOTE_ADDR"]."\r\n"); fputs($smtp, "Sender: $errorsto\r\n"); fputs($smtp, "Errors-To: $errorsto\r\n"); if($replyto != "") -- cgit v1.2.1