mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-24 17:47:40 +01:00
Handle proxy cascades on X-Forwrded-For
This commit is contained in:
parent
a9b4ace851
commit
60147e8d16
@ -35,7 +35,8 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && $lastchat < time()) {
|
||||
}
|
||||
}
|
||||
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
$data->ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
$proxy = array_map('trim', explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']));
|
||||
$data->ip = $proxy[0];
|
||||
}
|
||||
$content = getStandaloneFile('dynmap_webchat.json');
|
||||
$gotold = false;
|
||||
|
@ -35,7 +35,8 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && $lastchat < time()) {
|
||||
}
|
||||
}
|
||||
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
$data->ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
$proxy = array_map('trim', explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']));
|
||||
$data->ip = $proxy[0];
|
||||
}
|
||||
$content = getStandaloneFile('dynmap_webchat.json');
|
||||
$gotold = false;
|
||||
|
@ -35,7 +35,8 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && $lastchat < time()) {
|
||||
}
|
||||
}
|
||||
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
$data->ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
$proxy = array_map('trim', explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']));
|
||||
$data->ip = $proxy[0];
|
||||
}
|
||||
if (is_readable('dynmap_webchat.json')) {
|
||||
$old_messages = json_decode(file_get_contents('dynmap_webchat.json'), true);
|
||||
|
Loading…
Reference in New Issue
Block a user