Skip to content

Commit

Permalink
Issue 0000619: bad result of cookie_path() function
Browse files Browse the repository at this point in the history
After discussion with Radu of an other case, PATH_INFO is re-introduce with news conditions.


git-svn-id: http://piwigo.org/svn/trunk@2006 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rub committed May 11, 2007
1 parent d9d2a5a commit 21a95d9
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion include/functions_cookie.inc.php
Expand Up @@ -39,7 +39,21 @@ function cookie_path()
{
// mod_rewrite is activated for upper level directories. we must set the
// cookie to the path shown in the browser otherwise it will be discarded.
$scr = $_SERVER['REDIRECT_URL'];
if
(
isset($_SERVER['PATH_INFO']) and !empty($_SERVER['PATH_INFO']) and
($_SERVER['REDIRECT_URL'] !== $_SERVER['PATH_INFO']) and
(substr($_SERVER['REDIRECT_URL'],-strlen($_SERVER['PATH_INFO']))
== $_SERVER['PATH_INFO'])
)
{
$scr = substr($_SERVER['REDIRECT_URL'], 0,
strlen($_SERVER['REDIRECT_URL'])-strlen($_SERVER['PATH_INFO']));
}
else
{
$scr = $_SERVER['REDIRECT_URL'];
}
}
else
{
Expand Down

0 comments on commit 21a95d9

Please sign in to comment.