mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-02 16:52:16 +09:00
Add method to get real IP from CloudFlare headers
This commit is contained in:
parent
c23ebdb4aa
commit
343ad39b79
3 changed files with 47 additions and 23 deletions
|
|
@ -51,6 +51,11 @@ else
|
|||
/**
|
||||
* RX_CLIENT_IP_VERSION and RX_CLIENT_IP contain information about the current visitor's IP address.
|
||||
*/
|
||||
if (isset($_SERVER['HTTP_CF_CONNECTING_IP']))
|
||||
{
|
||||
include_once __DIR__ . '/framework/ipfilter.php';
|
||||
Rhymix\Framework\IpFilter::getCloudFlareRealIP();
|
||||
}
|
||||
if (isset($_SERVER['REMOTE_ADDR']) && preg_match('/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/', $_SERVER['REMOTE_ADDR'], $matches))
|
||||
{
|
||||
define('RX_CLIENT_IP_VERSION', 4);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue