diff options
author | plegall <plg@piwigo.org> | 2012-04-07 20:59:33 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2012-04-07 20:59:33 +0000 |
commit | 7f893c7b874f1030342c88be17bb39c930eefdbd (patch) | |
tree | 9a9090fb9fd34c45bba6cb71d0b96ed3756ddde1 /plugins/language_switch | |
parent | d6991c658e716b6483bd2e90fd662365cf6933d8 (diff) |
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/branches/2.3@13955 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'plugins/language_switch')
-rw-r--r-- | plugins/language_switch/language_switch.inc.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/language_switch/language_switch.inc.php b/plugins/language_switch/language_switch.inc.php index 730705f59..27ab5d1b2 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()) |