mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-29 20:59:59 +03:00
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
This commit is contained in:
parent
81e52ca603
commit
c59b052d7c
3 changed files with 17 additions and 0 deletions
|
@ -165,6 +165,11 @@ $languages = new languages('utf-8');
|
||||||
if (isset($_GET['language']))
|
if (isset($_GET['language']))
|
||||||
{
|
{
|
||||||
$language = strip_tags($_GET['language']);
|
$language = strip_tags($_GET['language']);
|
||||||
|
|
||||||
|
if (!in_array($language, array_keys($languages->fs_languages)))
|
||||||
|
{
|
||||||
|
$language = PHPWG_DEFAULT_LANGUAGE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,6 +41,13 @@ class language_controler
|
||||||
|
|
||||||
if (isset($_GET['lang']))
|
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 (!empty($_GET['lang']) and file_exists(PHPWG_ROOT_PATH.'language/'.$_GET['lang'].'/common.lang.php'))
|
||||||
{
|
{
|
||||||
if (is_a_guest() or is_generic())
|
if (is_a_guest() or is_generic())
|
||||||
|
|
|
@ -142,6 +142,11 @@ $languages = new languages('utf-8');
|
||||||
if (isset($_GET['language']))
|
if (isset($_GET['language']))
|
||||||
{
|
{
|
||||||
$language = strip_tags($_GET['language']);
|
$language = strip_tags($_GET['language']);
|
||||||
|
|
||||||
|
if (!in_array($language, array_keys($languages->fs_languages)))
|
||||||
|
{
|
||||||
|
$language = PHPWG_DEFAULT_LANGUAGE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue