diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-03-22 01:01:47 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-03-22 01:01:47 +0000 |
commit | 0971ce48d217b7cc8081ae70c4b041ab23fdf29c (patch) | |
tree | 841bd14e9c2a19c207fb8479b1a086112795d04a /include/functions_session.inc.php | |
parent | 3609c224c74f50a9049524ebedc996ddd1187108 (diff) |
URL rewriting: capable of fully working with urls without ?
URL rewriting: works with image file instead of image id (change
make_picture_url to generate urls with file name instead of image id)
URL rewriting: completely works with category/best_rated and
picture/best_rated/534 (change 'category.php?' to 'category' in make_index_url
and 'picture.php?' to 'picture' in make_picture_url to see it)
fix: picture category display in upper bar
fix: function rate_picture variables and use of the new user type
fix: caddie icon appears now on category page
fix: admin element_set sql query was using storage_category_id column
(column has moved to #image_categories)
fix: replaced some old $_GET[xxx] with $page[xxx]
fix: pictures have metadata url (use ? parameter - might change later)
git-svn-id: http://piwigo.org/svn/trunk@1092 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/functions_session.inc.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/include/functions_session.inc.php b/include/functions_session.inc.php index 9e1e3f152..482c76376 100644 --- a/include/functions_session.inc.php +++ b/include/functions_session.inc.php @@ -81,11 +81,26 @@ function cookie_path() if ( isset($_SERVER['REDIRECT_URL']) ) { // 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']) ) + { + $idx = strpos( $_SERVER['REDIRECT_URL'], $_SERVER['PATH_INFO'] ); + if ($idx !== false) + { + $scr = substr($_SERVER['REDIRECT_URL'], 0, $idx); + } + else + {//this should never happen + $scr='//'; + } + } + else + { + $scr = $_SERVER['REDIRECT_URL']; + } } else { - $scr = $_SERVER['PHP_SELF']; + $scr = $_SERVER['SCRIPT_NAME']; } return substr($scr,0,strrpos( $scr,'/')); } |