forked from GithubBackups/tinyib
Fallback to visitor IP address when CloudFlare IP address header is missing
Resolves #232.
This commit is contained in:
parent
13aff83a30
commit
013270c532
@ -212,8 +212,8 @@ function deletePostImages($post) {
|
|||||||
|
|
||||||
function deletePost($id) {
|
function deletePost($id) {
|
||||||
$id = intval($id);
|
$id = intval($id);
|
||||||
$is_op = false;
|
|
||||||
|
|
||||||
|
$is_op = false;
|
||||||
$parent = 0;
|
$parent = 0;
|
||||||
$op = array();
|
$op = array();
|
||||||
$posts = postsInThreadByID($id, false);
|
$posts = postsInThreadByID($id, false);
|
||||||
@ -969,7 +969,7 @@ function stripMetadata($filename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function remoteAddress() {
|
function remoteAddress() {
|
||||||
if (TINYIB_CLOUDFLARE) {
|
if (TINYIB_CLOUDFLARE && isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
|
||||||
return $_SERVER['HTTP_CF_CONNECTING_IP'];
|
return $_SERVER['HTTP_CF_CONNECTING_IP'];
|
||||||
}
|
}
|
||||||
return $_SERVER['REMOTE_ADDR'];
|
return $_SERVER['REMOTE_ADDR'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user