aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/docs/CHANGELOG.html1
-rw-r--r--phpBB/includes/acp/acp_board.php2
-rw-r--r--phpBB/includes/acp/acp_users.php2
-rw-r--r--phpBB/includes/session.php6
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php2
5 files changed, 7 insertions, 6 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 656624b569..72fb2d5ad4 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -296,6 +296,7 @@ p a {
<li>[Fix] Only convert non-orphaned PMs</li>
<li>[Fix] Fixed a few Postgres related errors (Bug #12587)</li>
<li>[Feature] New DBAL wrapper for LIKE expressions / sql_like_expression()</li>
+ <li>[Sec] Stricter validation of language entries. </li>
</ul>
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index c83155ef3e..c3b6d922b2 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -44,7 +44,7 @@ class acp_board
'site_desc' => array('lang' => 'SITE_DESC', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false),
'board_disable' => array('lang' => 'DISABLE_BOARD', 'validate' => 'bool', 'type' => 'custom', 'method' => 'board_disable', 'explain' => true),
'board_disable_msg' => false,
- 'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'string', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
+ 'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'lang', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false),
'board_dst' => array('lang' => 'SYSTEM_DST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 6015471b9d..ccb7589aee 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1149,7 +1149,7 @@ class acp_users
$data = array(
'dateformat' => request_var('dateformat', $user_row['user_dateformat'], true),
- 'lang' => request_var('lang', $user_row['user_lang']),
+ 'lang' => basename(request_var('lang', $user_row['user_lang'])),
'tz' => request_var('tz', (float) $user_row['user_timezone']),
'style' => request_var('style', $user_row['user_style']),
'dst' => request_var('dst', $user_row['user_dst']),
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index ec43c02bc9..c297a961a8 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -1206,7 +1206,7 @@ class user extends session
if ($this->data['user_id'] != ANONYMOUS)
{
$this->lang_name = (file_exists($phpbb_root_path . 'language/' . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : $config['default_lang'];
- $this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/';
+ $this->lang_path = $phpbb_root_path . 'language/' . basename($this->lang_name) . '/';
$this->date_format = $this->data['user_dateformat'];
$this->timezone = $this->data['user_timezone'] * 3600;
@@ -1215,7 +1215,7 @@ class user extends session
else
{
$this->lang_name = $config['default_lang'];
- $this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/';
+ $this->lang_path = $phpbb_root_path . 'language/' . basename($this->lang_name) . '/';
$this->date_format = $config['default_dateformat'];
$this->timezone = $config['board_timezone'] * 3600;
$this->dst = $config['board_dst'] * 3600;
@@ -1616,7 +1616,7 @@ class user extends session
{
global $phpbb_root_path, $config;
- $this->lang_path = $phpbb_root_path . 'language/' . $config['default_lang'] . '/';
+ $this->lang_path = $phpbb_root_path . 'language/' . basename($config['default_lang']) . '/';
}
// $lang == $this->lang
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index 9ef252b30f..8a10254a6e 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -32,7 +32,7 @@ class ucp_prefs
$data = array(
'notifymethod' => request_var('notifymethod', $user->data['user_notify_type']),
'dateformat' => request_var('dateformat', $user->data['user_dateformat'], true),
- 'lang' => request_var('lang', $user->data['user_lang']),
+ 'lang' => basename(request_var('lang', $user->data['user_lang'])),
'style' => request_var('style', (int) $user->data['user_style']),
'tz' => request_var('tz', (float) $user->data['user_timezone']),