Commit:    44ec8248249c6499bfaa2f2b95b7a9e961ecc0e4
Author:    Ferenc Kovacs <[email protected]>         Sun, 17 Feb 2013 23:22:48 
+0100
Parents:   5bab3e64f058c61f0c49f1a52ff09b6b06237012
Branches:  master

Link:       
http://git.php.net/?p=web/bugs.git;a=commitdiff;h=44ec8248249c6499bfaa2f2b95b7a9e961ecc0e4

Log:
REMOTE_ADDR not set when called from cli

Changed paths:
  M  include/functions.php


Diff:
diff --git a/include/functions.php b/include/functions.php
index 2603c1a..89ca62c 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1649,7 +1649,7 @@ function bugs_add_comment ($bug_id, $from, $from_name, 
$comment, $type = 'commen
                INSERT INTO bugdb_comments (bug, email, reporter_name, comment, 
comment_type, ts, visitor_ip)
                VALUES (?, ?, ?, ?, ?, NOW(), INET_ATON(?))
        ")->execute(array(
-               $bug_id, $from, $from_name, $comment, $type, 
$_SERVER['REMOTE_ADDR']
+               $bug_id, $from, $from_name, $comment, $type, 
(!empty($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:'127.0.0.1')
        ));
 }


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to