From ab9715a9fe5577921180a6f77b5a89b990665b6e Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 17 Jul 2009 11:32:27 +0000 Subject: Fix bugs #46615 & #46945 - Fail gracefully if store folder is not writable during update. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9768 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_update.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'phpBB/install/install_update.php') diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 388e217133..ccbad07e5b 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -915,6 +915,11 @@ class install_update extends module // Now init the connection if ($update_mode == 'download') { + if (function_exists('phpbb_is_writable') && !phpbb_is_writable($phpbb_root_path . 'store/')) + { + trigger_error(sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $phpbb_root_path . 'store/'), E_USER_ERROR); + } + if ($use_method == '.zip') { $compress = new compress_zip('w', $phpbb_root_path . 'store/' . $archive_filename . $use_method); -- cgit v1.2.1 From 8dcad17d1b938b04546254968c7a76ff39b8332d Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 7 Aug 2009 12:10:34 +0000 Subject: Fix bug #49215 - Use $phpEx variable instead of hardcoded '.php' git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9935 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_update.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/install/install_update.php') diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index ccbad07e5b..f73f741fae 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -1556,7 +1556,7 @@ class install_update extends module if ($info === false) { $update_info = array(); - include($phpbb_root_path . 'install/update/index.php'); + include($phpbb_root_path . 'install/update/index.' . $phpEx); $info = (empty($update_info) || !is_array($update_info)) ? false : $update_info; if ($info !== false) @@ -1570,7 +1570,7 @@ class install_update extends module global $phpbb_root_path, $phpEx; $update_info = array(); - include($phpbb_root_path . 'install/update/index.php'); + include($phpbb_root_path . 'install/update/index.' . $phpEx); $info = (empty($update_info) || !is_array($update_info)) ? false : $update_info; $errstr = ($info === false) ? $user->lang['WRONG_INFO_FILE_FORMAT'] : ''; -- cgit v1.2.1 From 090ab9bf0567734c951879b264744d16f41eceb3 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 7 Aug 2009 12:50:25 +0000 Subject: Bug #49215 again. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9936 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/install/install_update.php') diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index f73f741fae..a809afd4c7 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -206,7 +206,7 @@ class install_update extends module if (in_array('language/en/install.php', $this->update_info['files'])) { $lang = array(); - include($this->new_location . 'language/en/install.php'); + include($this->new_location . 'language/en/install.' . $phpEx); // only add new keys to user's language in english $new_keys = array_diff(array_keys($lang), array_keys($user->lang)); foreach ($new_keys as $i => $new_key) -- cgit v1.2.1 From e5fadfd42bc956a149e04370631b054213866544 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 10 Aug 2009 12:12:45 +0000 Subject: Bugs #15809, #49215 - Allow updater to work correctly with PHP filename extensions other than .php. Related revisions: r9935, r9936 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9948 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_update.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'phpBB/install/install_update.php') diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index a809afd4c7..ad72652e97 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -203,7 +203,7 @@ class install_update extends module } // What about the language file? Got it updated? - if (in_array('language/en/install.php', $this->update_info['files'])) + if (in_array('language/en/install.' . $phpEx, $this->update_info['files'])) { $lang = array(); include($this->new_location . 'language/en/install.' . $phpEx); @@ -1577,6 +1577,12 @@ class install_update extends module if ($info !== false) { + // We assume that all file extensions have been renamed to .$phpEx, + // if someone is using a non .php file extension for php files. + // However, in $update_info['files'] we use hardcoded .php. + // We therefore replace .php with .$phpEx. + $info['files'] = preg_replace('/\.php$/i', ".$phpEx", $info['files']); + // Adjust the update info file to hold some specific style-related information $info['custom'] = array(); /* -- cgit v1.2.1