Changeset 1443 for branches/branch-1_6


Ignore:
Timestamp:
Jul 8, 2006, 11:31:09 AM (18 years ago)
Author:
chrisaga
Message:

merge from trunk r14441:1442 into branch 1.6 (fix bug 458 : wrong path in sesion cookie)

File:
1 edited

Legend:

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

    r1429 r1443  
    8585function cookie_path()
    8686{
    87   if ( isset($_SERVER['REDIRECT_URL']) )
     87  if ( isset($_SERVER['REDIRECT_SCRIPT_NAME']) and
     88       !empty($_SERVER['REDIRECT_SCRIPT_NAME']) )
     89  {
     90    $scr = $_SERVER['REDIRECT_SCRIPT_NAME'];
     91  }
     92  else if ( isset($_SERVER['REDIRECT_URL']) )
    8893  { // mod_rewrite is activated for upper level directories. we must set the
    8994    // cookie to the path shown in the browser otherwise it will be discarded.
     
    109114    $scr = $_SERVER['SCRIPT_NAME'];
    110115  }
    111   return substr($scr,0,strrpos( $scr,'/'));
     116  $scr = substr($scr,0,strrpos( $scr,'/'));
     117  // add a trailing '/' if needed
     118  return ($scr{strlen($scr)-1} == '/') ? $scr : $scr . '/';
    112119}
    113120
Note: See TracChangeset for help on using the changeset viewer.