Changeset 2004


Ignore:
Timestamp:
May 8, 2007, 12:12:14 PM (17 years ago)
Author:
rub
Message:

Issue 0000619: bad result of cookie_path() function

I removed source code with PATH_INFO because this code generates problem on some environment and because I don't understand this utility (next substr extracts good value)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_cookie.inc.php

    r1993 r2004  
    3737  }
    3838  else if ( isset($_SERVER['REDIRECT_URL']) )
    39   { // mod_rewrite is activated for upper level directories. we must set the
     39  {
     40    // mod_rewrite is activated for upper level directories. we must set the
    4041    // cookie to the path shown in the browser otherwise it will be discarded.
    41     if ( isset($_SERVER['PATH_INFO']) and !empty($_SERVER['PATH_INFO']) )
    42     {
    43       $idx = strpos( $_SERVER['REDIRECT_URL'], $_SERVER['PATH_INFO'] );
    44       if ($idx !== false)
    45       {
    46         $scr = substr($_SERVER['REDIRECT_URL'], 0, $idx);
    47       }
    48       else
    49       {//this should never happen
    50         $scr='//';
    51       }
    52     }
    53     else
    54     {
    55       $scr = $_SERVER['REDIRECT_URL'];
    56     }
     42    $scr = $_SERVER['REDIRECT_URL'];
    5743  }
    5844  else
     
    6046    $scr = $_SERVER['SCRIPT_NAME'];
    6147  }
     48
    6249  $scr = substr($scr,0,strrpos( $scr,'/'));
    6350
Note: See TracChangeset for help on using the changeset viewer.