From c59b052d7c84001fb267b38e24c20c51b33c6853 Mon Sep 17 00:00:00 2001 From: plegall Date: Sat, 7 Apr 2012 21:00:51 +0000 Subject: merge r13955 from branch 2.3 to trunk bug 2610 fixed: make sure the $_GET['lang'] or $_GET['language'] is in the list of available languages. git-svn-id: http://piwigo.org/svn/trunk@13956 68402e56-0260-453c-a942-63ccdbb3a9ee --- plugins/language_switch/language_switch.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'plugins/language_switch') diff --git a/plugins/language_switch/language_switch.inc.php b/plugins/language_switch/language_switch.inc.php index 9ba5b0931..fc06da5d3 100644 --- a/plugins/language_switch/language_switch.inc.php +++ b/plugins/language_switch/language_switch.inc.php @@ -41,6 +41,13 @@ class language_controler if (isset($_GET['lang'])) { + include_once(PHPWG_ROOT_PATH . 'admin/include/languages.class.php'); + $languages = new languages(); + if (!in_array($_GET['lang'], array_keys($languages->fs_languages))) + { + $_GET['lang'] = PHPWG_DEFAULT_LANGUAGE; + } + if (!empty($_GET['lang']) and file_exists(PHPWG_ROOT_PATH.'language/'.$_GET['lang'].'/common.lang.php')) { if (is_a_guest() or is_generic()) -- cgit v1.2.3