diff --git a/phpBB/includes/functions_selects.php b/phpBB/includes/functions_selects.php index f669b27499..3335795213 100644 --- a/phpBB/includes/functions_selects.php +++ b/phpBB/includes/functions_selects.php @@ -33,7 +33,7 @@ function language_select($default, $select_name = "language", $dirname="language $lang = array(); while ( $file = readdir($dir) ) { - if ( ereg("^lang_", $file) && !is_file($dirname . "/" . $file) && !is_link($dirname . "/" . $file) ) + if (preg_match('#^lang_#i', $file) && !is_file(@phpbb_realpath($phpbb_root_path . $dirname . '/' . $file)) && !is_link(@phpbb_realpath($phpbb_root_path . $dirname . '/' . $file))) { $filename = trim(str_replace("lang_", "", $file)); $displayname = preg_replace("/^(.*?)_(.*)$/", "\\1 [ \\2 ]", $filename);