From addcea9cd45a87f2ae56f879bad86425efc16fba Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 6 Jan 2015 21:10:51 +0100 Subject: Fix i18n loading and availableLanguages calls - Change the way to init i18n - Add a availableLanguages() method to Minz_Translate See https://github.com/FreshRSS/FreshRSS/issues/730 --- lib/Minz/Session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Minz/Session.php') diff --git a/lib/Minz/Session.php b/lib/Minz/Session.php index af4de75bb..cfe8debe9 100644 --- a/lib/Minz/Session.php +++ b/lib/Minz/Session.php @@ -55,7 +55,7 @@ class Minz_Session { if (!$force) { self::_param('language', $language); - Minz_Translate::reset(); + Minz_Translate::reset($language); } } -- cgit v1.2.3 From eec95ffb6a414f00f0ddd6cb1f81ac7ee55d4f6b Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 21 Jan 2015 15:43:25 +0100 Subject: Fix bug related to cookie path Fix https://github.com/FreshRSS/FreshRSS/issues/700 --- lib/Minz/Session.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/Minz/Session.php') diff --git a/lib/Minz/Session.php b/lib/Minz/Session.php index cfe8debe9..4c0c37e54 100644 --- a/lib/Minz/Session.php +++ b/lib/Minz/Session.php @@ -65,7 +65,9 @@ class Minz_Session { * @param $l la durée de vie */ public static function keepCookie($l) { - $cookie_dir = empty($_SERVER['REQUEST_URI']) ? '' : $_SERVER['REQUEST_URI']; + // Get the script_name (e.g. /p/i/index.php) and remove index.php + $cookie_dir = empty($_SERVER['SCRIPT_NAME']) ? '' : $_SERVER['SCRIPT_NAME']; + $cookie_dir = substr($cookie_dir, 0, -strlen(basename($cookie_dir))); session_set_cookie_params($l, $cookie_dir, '', false, true); } -- cgit v1.2.3 From 22d7e0d638b91063741fe82fe77822b1d7d5be1d Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 21 Jan 2015 16:28:29 +0100 Subject: Simplify code for cookie dir See https://github.com/FreshRSS/FreshRSS/issues/700 See https://github.com/FreshRSS/FreshRSS/commit/eec95ffb6a414f00f0ddd6cb1f81ac7ee55d4f6b --- lib/Minz/Session.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Minz/Session.php') diff --git a/lib/Minz/Session.php b/lib/Minz/Session.php index 4c0c37e54..058685ada 100644 --- a/lib/Minz/Session.php +++ b/lib/Minz/Session.php @@ -65,9 +65,9 @@ class Minz_Session { * @param $l la durée de vie */ public static function keepCookie($l) { - // Get the script_name (e.g. /p/i/index.php) and remove index.php + // Get the script_name (e.g. /p/i/index.php) and keep only the path. $cookie_dir = empty($_SERVER['SCRIPT_NAME']) ? '' : $_SERVER['SCRIPT_NAME']; - $cookie_dir = substr($cookie_dir, 0, -strlen(basename($cookie_dir))); + $cookie_dir = dirname($cookie_dir); session_set_cookie_params($l, $cookie_dir, '', false, true); } -- cgit v1.2.3