diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 090a36b0e3..5863ff1f53 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -288,22 +288,25 @@ function make_jumpbox($action, $forum_id = false, $extra_form_fields = array())
}
// Pick a language, any language ...
-function language_select($default, $select_name = "language", $dirname="language")
+function language_select($default = '')
{
- global $phpEx;
+ global $phpbb_root_path, $phpEx;
- $dir = @opendir($dirname);
+ $dir = @opendir($phpbb_root_path . 'language');
$user = array();
while ($file = readdir($dir))
{
- if (!is_dir($dirname . '/' . $file))
+ $path = $phpbb_root_path . 'language/' . $file;
+
+ if (is_file($path) || is_link($path) || $file == '.' || $file == '..')
{
continue;
}
- if (@file_exists($dirname . '/' . $file . '/iso.txt'))
+
+ if (file_exists($path . '/iso.txt'))
{
- list($displayname) = file($dirname . '/' . $file . '/iso.txt');
+ list($displayname) = @file($path . '/iso.txt');
$lang[$displayname] = $file;
}
}
@@ -312,19 +315,17 @@ function language_select($default, $select_name = "language", $dirname="language
@asort($lang);
@reset($lang);
- $user_select = '';
return $user_select;
}
// Pick a template/theme combo,
-function style_select($default_style, $select_name = 'style', $dirname = 'templates')
+function style_select($default = '')
{
global $db;
@@ -333,30 +334,29 @@ function style_select($default_style, $select_name = 'style', $dirname = 'templa
ORDER BY style_name, style_id";
$result = $db->sql_query($sql);
- $style_select = '";
return $style_select;
}
// Pick a timezone
-function tz_select($default, $select_name = 'timezone')
+function tz_select($default = '')
{
global $sys_timezone, $user;
- $tz_select = '';
return $tz_select;
}