From e08f1341127792e378580a10bbb0bdeafe93ff8d Mon Sep 17 00:00:00 2001 From: Mate Bartus Date: Thu, 23 Jul 2015 22:55:31 +0200 Subject: [PATCH] [ticket/13740] Fix is_phpbb_installed() method PHPBB3-13740 --- phpBB/phpbb/install/controller/install.php | 2 +- phpBB/phpbb/install/helper/install_helper.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/phpbb/install/controller/install.php b/phpBB/phpbb/install/controller/install.php index 469e2608a4..904f5920c2 100644 --- a/phpBB/phpbb/install/controller/install.php +++ b/phpBB/phpbb/install/controller/install.php @@ -111,7 +111,7 @@ class install { if ($this->install_helper->is_phpbb_installed()) { - throw new http_exception(404, 'PAGE_NOT_FOUND'); + die ('phpBB is already installed'); } $this->template->assign_vars(array( diff --git a/phpBB/phpbb/install/helper/install_helper.php b/phpBB/phpbb/install/helper/install_helper.php index c1506de5bf..ffe36cd645 100644 --- a/phpBB/phpbb/install/helper/install_helper.php +++ b/phpBB/phpbb/install/helper/install_helper.php @@ -47,14 +47,14 @@ class install_helper */ public function is_phpbb_installed() { - $config_path = $this->phpbb_root_path . 'config' . $this->php_ext; + $config_path = $this->phpbb_root_path . 'config.' . $this->php_ext; $install_lock_path = $this->phpbb_root_path . 'cache/install_lock'; - if (file_exists($config_path) && !file_exists($install_lock_path)) + if (file_exists($config_path) && !file_exists($install_lock_path) && filesize($config_path)) { - include_once $config_path; + return true; } - return defined('PHPBB_INSTALLED'); + return false; } }