From 4349bec316e93ed6feac3ad7e56e54b6320aa960 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 13 Mar 2010 11:37:06 +0100 Subject: [PATCH] [bug/59135] Fix open_basedir issues when accessing styles- and language-management. (Bug #59135) introduced in r10496 and r10360/r10361 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/acp/acp_language.php | 4 ++-- phpBB/includes/acp/acp_styles.php | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 7b8d8f63f2..e6cefc15c4 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -103,6 +103,7 @@
  • [Fix] Allow multibyte keys in request_var(). (Bug #51555)
  • [Fix] Prevent wrong tar archive type detection. (Bug #12531)
  • [Fix] Correct redirection after login to forum not in web root (Bug #58755)
  • +
  • [Fix] Fix open_basedir issues when accessing styles- and language-management. (Bug #59135)
  • [Feature] Support for Microsoft's Native SQL Server Driver for PHP (Bug #57055 - Patch by Chris Pucci at Microsoft)
  • diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index fedae6fe67..c2cb2f9c11 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -1120,12 +1120,12 @@ class acp_language { while (($file = readdir($dp)) !== false) { - if (!is_dir($phpbb_root_path . 'language/' . $file)) + if ($file[0] == '.' || !is_dir($phpbb_root_path . 'language/' . $file)) { continue; } - if ($file[0] != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt")) + if (file_exists("{$phpbb_root_path}language/$file/iso.txt")) { if (!in_array($file, $installed)) { diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index d2a0f9210f..3310560c73 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -643,13 +643,13 @@ parse_css_file = {PARSE_CSS_FILE} { while (($file = readdir($dp)) !== false) { - if (!is_dir($phpbb_root_path . 'styles/' . $file)) + if ($file[0] == '.' || !is_dir($phpbb_root_path . 'styles/' . $file)) { continue; } $subpath = ($mode != 'style') ? "$mode/" : ''; - if ($file[0] != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg")) + if (file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg")) { if ($cfg = file("{$phpbb_root_path}styles/$file/$subpath$mode.cfg")) {