diff options
| author | root | 2014-12-05 05:06:52 +0100 |
|---|---|---|
| committer | root | 2014-12-05 05:06:52 +0100 |
| commit | 1ffa65c88b570aca2b5d3b9b7202e30beeee2fe7 (patch) | |
| tree | 6f9ac147713e39c0fe374307c8228287b1dad8c7 /header/index.php | |
| parent | fe476696fb1200d0ea366d056dca976cb45373f9 (diff) | |
| download | tools.iamfabulous.de-1ffa65c88b570aca2b5d3b9b7202e30beeee2fe7.tar.gz | |
Made it ipv6 ready.
Diffstat (limited to 'header/index.php')
| -rw-r--r-- | header/index.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/header/index.php b/header/index.php index 056cde5..6fd41e0 100644 --- a/header/index.php +++ b/header/index.php @@ -42,6 +42,15 @@ if ( $set ){ require '../tools/class/redis.php'; + function ipv6($ip){ + + if ( filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) ) { + return true; + } + + return false; + } + $redis = new Database(REDIS_CONNECT, 9); $key = md5( $url . $method . serialize($customHeader) ); @@ -51,7 +60,14 @@ if ( $set ){ } $agent = "Retrieve HTTP headers online. v0.1"; - $ch = curl_init($url); + $ch = curl_init(); + + if ( ipv6($url) ){ + $url = "[".$url."]"; + curl_setopt($ch,CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6); + } + + curl_setopt ($ch, CURLOPT_URL,$url ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
