Changeset 2007


Ignore:
Timestamp:
May 11, 2007, 10:09:21 PM (17 years ago)
Author:
rub
Message:

Issue 0000619: bad result of cookie_path() function

After discussion with Radu of an other case, PATH_INFO is re-introduce with news conditions.

Apply modifications from BSF (2006) ;-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1_7/include/functions_session.inc.php

    r2005 r2007  
    9090    // mod_rewrite is activated for upper level directories. we must set the
    9191    // cookie to the path shown in the browser otherwise it will be discarded.
    92     $scr = $_SERVER['REDIRECT_URL'];
     92    if
     93      (
     94        isset($_SERVER['PATH_INFO']) and !empty($_SERVER['PATH_INFO']) and
     95        ($_SERVER['REDIRECT_URL'] !== $_SERVER['PATH_INFO']) and
     96        (substr($_SERVER['REDIRECT_URL'],-strlen($_SERVER['PATH_INFO']))
     97            == $_SERVER['PATH_INFO'])
     98      )
     99    {
     100      $scr = substr($_SERVER['REDIRECT_URL'], 0,
     101        strlen($_SERVER['REDIRECT_URL'])-strlen($_SERVER['PATH_INFO']));
     102    }
     103    else
     104    {
     105      $scr = $_SERVER['REDIRECT_URL'];
     106    }
    93107  }
    94108  else
Note: See TracChangeset for help on using the changeset viewer.