diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-05-25 15:04:42 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-05-25 15:04:42 +0000 |
commit | 4a6f5869e5df2433643199d2ab239569b3ece6b2 (patch) | |
tree | a4e1b24621988089bc8e35c02d7b33f71c8eb901 /modules/poll | |
parent | 5b45c4afc55a80cf8babf071072c4653d8a4b23c (diff) | |
download | brdo-4a6f5869e5df2433643199d2ab239569b3ece6b2.tar.gz brdo-4a6f5869e5df2433643199d2ab239569b3ece6b2.tar.bz2 |
- Patch #142773 by kbahey: made Drupal work correctly when behind a reverse proxy.
Diffstat (limited to 'modules/poll')
-rw-r--r-- | modules/poll/poll.module | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 8fef97946..8fb710cae 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -308,7 +308,7 @@ function poll_load($node) { $result = db_fetch_object(db_query('SELECT chorder FROM {poll_votes} WHERE nid = %d AND uid = %d', $node->nid, $user->uid)); } else { - $result = db_fetch_object(db_query("SELECT chorder FROM {poll_votes} WHERE nid = %d AND hostname = '%s'", $node->nid, $_SERVER['REMOTE_ADDR'])); + $result = db_fetch_object(db_query("SELECT chorder FROM {poll_votes} WHERE nid = %d AND hostname = '%s'", $node->nid, ip_address())); } if (isset($result->chorder)) { $poll->vote = $result->chorder; @@ -534,7 +534,7 @@ function poll_vote(&$node) { db_query('INSERT INTO {poll_votes} (nid, chorder, uid) VALUES (%d, %d, %d)', $node->nid, $choice, $user->uid); } else { - db_query("INSERT INTO {poll_votes} (nid, chorder, hostname) VALUES (%d, %d, '%s')", $node->nid, $choice, $_SERVER['REMOTE_ADDR']); + db_query("INSERT INTO {poll_votes} (nid, chorder, hostname) VALUES (%d, %d, '%s')", $node->nid, $choice, ip_address()); } // Add one to the votes. @@ -573,7 +573,7 @@ function poll_cancel(&$node) { db_query('DELETE FROM {poll_votes} WHERE nid = %d and uid = %d', $node->nid, $user->uid); } else { - db_query("DELETE FROM {poll_votes} WHERE nid = %d and hostname = '%s'", $node->nid, $_SERVER['REMOTE_ADDR']); + db_query("DELETE FROM {poll_votes} WHERE nid = %d and hostname = '%s'", $node->nid, ip_address()); } // Subtract from the votes. |