Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
6c99c2d8
Commit
6c99c2d8
authored
Feb 10, 2004
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#5766
by Moshe: replace getenv() with $_SERVER.
parent
38e89dd0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
4 deletions
+6
-4
modules/comment.module
modules/comment.module
+1
-1
modules/comment/comment.module
modules/comment/comment.module
+1
-1
modules/statistics.module
modules/statistics.module
+2
-1
modules/statistics/statistics.module
modules/statistics/statistics.module
+2
-1
No files found.
modules/comment.module
View file @
6c99c2d8
...
...
@@ -435,7 +435,7 @@ function comment_post($edit) {
$edit
[
"cid"
]
=
db_next_id
(
"
{
comments
}
_cid"
);
db_query
(
"INSERT INTO
{
comments
}
(cid, nid, pid, uid, subject, comment, hostname, timestamp, status, score, users, thread) VALUES (%d, %d, %d, %d, '%s', '%s', '%s', %d, %d, %d, '%s', '%s')"
,
$edit
[
"cid"
],
$edit
[
"nid"
],
$edit
[
"pid"
],
$user
->
uid
,
$edit
[
"subject"
],
$edit
[
"comment"
],
getenv
(
"
REMOTE_ADDR
"
)
,
time
(),
$status
,
$score
,
$users
,
$thread
);
db_query
(
"INSERT INTO
{
comments
}
(cid, nid, pid, uid, subject, comment, hostname, timestamp, status, score, users, thread) VALUES (%d, %d, %d, %d, '%s', '%s', '%s', %d, %d, %d, '%s', '%s')"
,
$edit
[
"cid"
],
$edit
[
"nid"
],
$edit
[
"pid"
],
$user
->
uid
,
$edit
[
"subject"
],
$edit
[
"comment"
],
$_SERVER
[
'
REMOTE_ADDR
'
]
,
time
(),
$status
,
$score
,
$users
,
$thread
);
/*
** Tell the other modules a new comment has been submitted:
...
...
modules/comment/comment.module
View file @
6c99c2d8
...
...
@@ -435,7 +435,7 @@ function comment_post($edit) {
$edit
[
"cid"
]
=
db_next_id
(
"
{
comments
}
_cid"
);
db_query
(
"INSERT INTO
{
comments
}
(cid, nid, pid, uid, subject, comment, hostname, timestamp, status, score, users, thread) VALUES (%d, %d, %d, %d, '%s', '%s', '%s', %d, %d, %d, '%s', '%s')"
,
$edit
[
"cid"
],
$edit
[
"nid"
],
$edit
[
"pid"
],
$user
->
uid
,
$edit
[
"subject"
],
$edit
[
"comment"
],
getenv
(
"
REMOTE_ADDR
"
)
,
time
(),
$status
,
$score
,
$users
,
$thread
);
db_query
(
"INSERT INTO
{
comments
}
(cid, nid, pid, uid, subject, comment, hostname, timestamp, status, score, users, thread) VALUES (%d, %d, %d, %d, '%s', '%s', '%s', %d, %d, %d, '%s', '%s')"
,
$edit
[
"cid"
],
$edit
[
"nid"
],
$edit
[
"pid"
],
$user
->
uid
,
$edit
[
"subject"
],
$edit
[
"comment"
],
$_SERVER
[
'
REMOTE_ADDR
'
]
,
time
(),
$status
,
$score
,
$users
,
$thread
);
/*
** Tell the other modules a new comment has been submitted:
...
...
modules/statistics.module
View file @
6c99c2d8
...
...
@@ -21,7 +21,8 @@ function statistics_exit() {
if
((
variable_get
(
"statistics_enable_access_log"
,
0
))
&&
(
module_invoke
(
"throttle"
,
"status"
)
<
5
))
{
// statistical logs are enabled
$referrer
=
referer_uri
();
$hostname
=
getenv
(
"REMOTE_ADDR"
);
$hostname
=
$_SERVER
[
'REMOTE_ADDR'
];
// log this page access
if
((
arg
(
0
)
==
"node"
)
&&
(
arg
(
1
)
==
"view"
)
&&
arg
(
2
))
{
db_query
(
"INSERT INTO
{
accesslog
}
(nid, url, hostname, uid, timestamp) values(%d, '%s', '%s', %d, %d)"
,
arg
(
2
),
$referrer
,
$hostname
,
$user
->
uid
,
time
());
...
...
modules/statistics/statistics.module
View file @
6c99c2d8
...
...
@@ -21,7 +21,8 @@ function statistics_exit() {
if
((
variable_get
(
"statistics_enable_access_log"
,
0
))
&&
(
module_invoke
(
"throttle"
,
"status"
)
<
5
))
{
// statistical logs are enabled
$referrer
=
referer_uri
();
$hostname
=
getenv
(
"REMOTE_ADDR"
);
$hostname
=
$_SERVER
[
'REMOTE_ADDR'
];
// log this page access
if
((
arg
(
0
)
==
"node"
)
&&
(
arg
(
1
)
==
"view"
)
&&
arg
(
2
))
{
db_query
(
"INSERT INTO
{
accesslog
}
(nid, url, hostname, uid, timestamp) values(%d, '%s', '%s', %d, %d)"
,
arg
(
2
),
$referrer
,
$hostname
,
$user
->
uid
,
time
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment