com web/bugs: REMOTE_ADDR not set when called from cli: include/functions.php
| From: | Ferenc Kovacs | Date: | Sun, 17 Feb 2013 22:22:48 +0000 |
| Subject: | com web/bugs: REMOTE_ADDR not set when called from cli: include/functions.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-15490@lists.php.net to get a copy of this message | ||
Commit: 44ec8248249c6499bfaa2f2b95b7a9e961ecc0e4
Author: Ferenc Kovacs <tyra3l@gmail.com> 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')
));
}