Is this a bug , or just happens on my server?

Hi , few moments ago i tried to save the session in database , but had some troubles with ip_address() function .
I am running lighttpd , and the ouput of the $_SERVER looks like :

    [PATH] => /sbin:/bin:/usr/sbin:/usr/bin
    [SHELL] => /bin/bash
    [USER] => Twisted1919
    [PHP_FCGI_MAX_REQUESTS] => 10000
    [SERVER_SOFTWARE] => lighttpd/1.4.19
    [SERVER_NAME] =>
    [SERVER_PORT] => 80
    [SERVER_ADDR] => ::ffff:86.34.yy.xx
    [REMOTE_PORT] => 60319
    [REMOTE_ADDR] => ::ffff:86.34.yy.xx
    [SCRIPT_NAME] => /index.php
    [PATH_INFO] => /admin
    [PATH_TRANSLATED] => /var/www/admin
    [SCRIPT_FILENAME] => /var/www/index.php
    [DOCUMENT_ROOT] => /var/www/
    [REQUEST_URI] => /admin
    [REDIRECT_URI] => /index.php/admin
    [REDIRECT_STATUS] => 200
    [HTTP_HOST] =>
    [HTTP_USER_AGENT] => Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20090729 Firefox/3.5.2
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5
    [HTTP_ACCEPT_ENCODING] => gzip,deflate
    [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
    [HTTP_KEEP_ALIVE] => 300
    [HTTP_CONNECTION] => keep-alive
    [HTTP_COOKIE] => Blah Blah , Not Important
    [ORIG_SCRIPT_FILENAME] => /var/www/index.php/admin
    [ORIG_PATH_TRANSLATED] => /var/www/admin
    [PHP_SELF] => /index.php/admin
    [REQUEST_TIME] => 1250060984
So the ip address looks like this ::ffff: which obiously is not a valid ipv4 address and the ip_address() from the input class return false on it so in my database all the ip addresses are like .
For the moment i found a workaround to this by str_replace-ing the $_SERVER['REMOTE_ADDR'] from the ip_address() method but i would like to know if this is a bug of CI or just happens with lighttpd ?
Ah , of course , and the real solution to this Smile
P.S: CI from SVN at date .
Thx .

Ahh, the thrill of IPv6.

What does [url=""]$this->input->ip_address()[/url] actually give you?

EDIT: {facepalm} Sorry - just re-read your message - it returns FALSE. Okay .. I've seen something like this before, in my pre-CI days, and there was another server variable that you could call on - I'll have a dig around and see if I can find it, but I seem to recall it was something that was being deprecated even back then, perhaps as long ago as PHP4.

Now , with that little hack gives my real ip , but without gives : .
Edit : well i don't know what is causing this . Maybe php 5.3.0 (that version i'm running)?

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.