Update of /cvsroot/php-blog/serendipity/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1635/include
Modified Files:
functions_comments.inc.php
Log Message:
Save HTTP referrer for a user when entering a comment.
Discussed in http://thread.gmane.org/gmane.comp.serendipity.devel/3215
(I think user-agent logging is not neccessary, can be drawn out of usual access logs...)
Index: functions_comments.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/functions_comments.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- functions_comments.inc.php 2 Dec 2004 14:11:27 -0000 1.8
+++ functions_comments.inc.php 3 Dec 2004 10:07:39 -0000 1.9
@@ -317,6 +317,7 @@
$parentid = (isset($commentInfo['parent_id']) && is_numeric($commentInfo['parent_id'])) ? $commentInfo['parent_id'] : 0;
$status = isset($commentInfo['status']) ? $commentInfo['status'] : (serendipity_db_bool($ca['moderate_comments']) ? 'pending' : 'approved');
$t = isset($commentInfo['time']) ? $commentInfo['time'] : time();
+ $referer = (isset($_SESSION['HTTP_REFERER']) ? serendipity_db_escape_string($_SESSION['HTTP_REFERER']) : '');
if (isset($commentInfo['subscribe'])) {
$subscribe = 'true';
@@ -324,8 +325,8 @@
$subscribe = 'false';
}
- $query = "INSERT INTO {$serendipity['dbPrefix']}comments (entry_id, parent_id, ip, author, email, url, body, type, timestamp, title, subscribed, status)";
- $query .= " VALUES ('$id', '$parentid', '$ip', '$name', '$email', '$url', '$commentsFixed', '$type', '$t', '$title', '$subscribe', '$status')";
+ $query = "INSERT INTO {$serendipity['dbPrefix']}comments (entry_id, parent_id, ip, author, email, url, body, type, timestamp, title, subscribed, status, referer)";
+ $query .= " VALUES ('$id', '$parentid', '$ip', '$name', '$email', '$url', '$commentsFixed', '$type', '$t', '$title', '$subscribe', '$status', '$referer')";
serendipity_db_query($query);
$cid = serendipity_db_insert_id('comments', 'id');
|