aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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 ()) {