summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-26 01:56:58 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-26 01:56:58 +0100
commit58300c36ad77e8d788e99825d509fe8657a36854 (patch)
tree6167a28a3c728c65c30256c1f29fd0a0552d8676 /lib
parent1da74b1eddfafd9191548e0fde150690b80f694b (diff)
Cookie : sous-répertoire pour index (changements de répertoires !)
Implémente https://github.com/marienfressinaud/FreshRSS/issues/333 /public/ est renommé /p/ /public/index.php est déplacé dans /p/i/index.php Le cookie de session est limité à /p/i/
Diffstat (limited to 'lib')
-rw-r--r--lib/Minz/Session.php1
-rw-r--r--lib/Minz/Url.php15
2 files changed, 10 insertions, 6 deletions
diff --git a/lib/Minz/Session.php b/lib/Minz/Session.php
index c2af920df..f527322f5 100644
--- a/lib/Minz/Session.php
+++ b/lib/Minz/Session.php
@@ -18,6 +18,7 @@ class Minz_Session {
public static function init ($name) {
// démarre la session
session_name ($name);
+ session_set_cookie_params (0, './', null, false, true);
session_start ();
if (isset ($_SESSION)) {
diff --git a/lib/Minz/Url.php b/lib/Minz/Url.php
index 30f7f6231..17f1ddece 100644
--- a/lib/Minz/Url.php
+++ b/lib/Minz/Url.php
@@ -17,12 +17,16 @@ class Minz_Url {
* @return l'url formatée
*/
public static function display ($url = array (), $encodage = 'html', $absolute = false) {
- $url = self::checkUrl ($url);
+ $isArray = is_array($url);
+
+ if ($isArray) {
+ $url = self::checkUrl ($url);
+ }
$url_string = '';
if ($absolute) {
- if (is_array ($url) && isset ($url['protocol'])) {
+ if ($isArray && isset ($url['protocol'])) {
$protocol = $url['protocol'];
} elseif (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$protocol = 'https:';
@@ -30,12 +34,11 @@ class Minz_Url {
$protocol = 'http:';
}
$url_string = $protocol . '//' . Minz_Request::getDomainName () . Minz_Request::getBaseUrl ();
- }
- else {
- $url_string = '.';
+ } else {
+ $url_string = $isArray ? '.' : PUBLIC_RELATIVE;
}
- if (is_array ($url)) {
+ if ($isArray) {
$router = new Minz_Router ();
if (Minz_Configuration::useUrlRewriting ()) {