function generateUrl($uri, $print = true) { /* If session.use_trans_sid is on then it will add the session id. */ if (!GallerySetupUtilities::areCookiesSupported() && !ini_get('session.use_trans_sid')) { $sid = session_name() . '=' . session_id(); $uri .= (!strpos($uri, '?') ? '?' : '&') . $sid; } if ($print) { print $uri; } return $uri; }
/** * Mini url generator for the installer */ function generateUrl($uri, $print = true) { if (!strncmp($uri, 'index.php', 9)) { /* Cookieless browsing: If session.use_trans_sid is on then it will add the session id. */ if (!GallerySetupUtilities::areCookiesSupported() && !ini_get('session.use_trans_sid')) { /* * Don't use SID since it's a constant and we change (regenerate) the session id * in the request */ $sid = session_name() . '=' . session_id(); $uri .= !strpos($uri, '?') ? '?' : '&'; $uri .= $sid; } } if ($print) { print $uri; } return $uri; }
/** * Mini url generator for upgrader */ function generateUrl($uri, $print = true) { if (strncmp($uri, 'index.php', 9) && strncmp($uri, '../' . GALLERY_MAIN_PHP, 11)) { /* upgrade/images/*, upgrade/styles/*, ... URLs */ global $gallery; /* Add @ here in case we haven't yet upgraded config.php to include galleryBaseUrl */ $baseUrl = @$gallery->getConfig('galleryBaseUrl'); if (!empty($baseUrl)) { $uri = $baseUrl . 'upgrade/' . $uri; } } else { if (!strncmp($uri, 'index.php', 9)) { /* If session.use_trans_sid is on then it will add the session id. */ if (!GallerySetupUtilities::areCookiesSupported() && !ini_get('session.use_trans_sid')) { /* * Don't use SID since it's a constant and we change (regenerate) the session id * in the request */ $sid = session_name() . '=' . session_id(); $uri .= !strpos($uri, '?') ? '?' : '&'; $uri .= $sid; } } } if ($print) { print $uri; } return $uri; }