aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--install.php5
-rw-r--r--plugins/language_switch/language_switch.inc.php7
-rw-r--r--upgrade.php5
3 files changed, 17 insertions, 0 deletions
diff --git a/install.php b/install.php
index 9a877a25b..4271fdf26 100644
--- a/install.php
+++ b/install.php
@@ -178,6 +178,11 @@ $languages = new languages('utf-8');
if (isset($_GET['language']))
{
$language = strip_tags($_GET['language']);
+
+ if (!in_array($language, array_keys($languages->fs_languages)))
+ {
+ $language = PHPWG_DEFAULT_LANGUAGE;
+ }
}
else
{
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())
diff --git a/upgrade.php b/upgrade.php
index 43cf70b7a..ea0bbe516 100644
--- a/upgrade.php
+++ b/upgrade.php
@@ -154,6 +154,11 @@ $languages = new languages('utf-8');
if (isset($_GET['language']))
{
$language = strip_tags($_GET['language']);
+
+ if (!in_array($language, array_keys($languages->fs_languages)))
+ {
+ $language = PHPWG_DEFAULT_LANGUAGE;
+ }
}
else
{