diff options
Diffstat (limited to 'include/functions_session.inc.php')
-rw-r--r-- | include/functions_session.inc.php | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/include/functions_session.inc.php b/include/functions_session.inc.php index b2509e1c1..8a3bb911c 100644 --- a/include/functions_session.inc.php +++ b/include/functions_session.inc.php @@ -109,28 +109,23 @@ function add_session_id( $url, $redirect = false ) { global $page, $user, $conf; - if ( $user['has_cookie'] or $conf['apache_authentication']) return $url; - - $amp = '&'; - if ( $redirect ) + if ($user['is_the_guest'] + or $user['has_cookie'] + or $conf['apache_authentication']) { - $amp = '&'; + return $url; } - if ( !$user['is_the_guest'] ) + + if (preg_match('/\.php\?/', $url)) { - if ( preg_match( '/\.php\?/',$url ) ) - { - return $url.$amp.'id='.$page['session_id']; - } - else - { - return $url.'?id='.$page['session_id']; - } + $separator = $redirect ? '&' : '&'; } else { - return $url; + $separator = '?'; } + + return $url.$separator.'id='.$page['session_id']; } // cookie_path returns the path to use for the PhpWebGallery cookie. |