diff options
author | Mate Bartus <mate.bartus@gmail.com> | 2015-10-18 19:27:50 +0200 |
---|---|---|
committer | Mate Bartus <mate.bartus@gmail.com> | 2015-10-18 19:27:50 +0200 |
commit | ed442198d1fff379b65b8d4a1c3bfb15890cfed1 (patch) | |
tree | 554dc4dbdfab3eb27a2c7b4922db46dbf4570746 /phpBB | |
parent | 56093d1c82d6f4d5c0f2741769eb071eb7bec5d7 (diff) | |
download | forums-ed442198d1fff379b65b8d4a1c3bfb15890cfed1.tar forums-ed442198d1fff379b65b8d4a1c3bfb15890cfed1.tar.gz forums-ed442198d1fff379b65b8d4a1c3bfb15890cfed1.tar.bz2 forums-ed442198d1fff379b65b8d4a1c3bfb15890cfed1.tar.xz forums-ed442198d1fff379b65b8d4a1c3bfb15890cfed1.zip |
[ticket/14039] Fix ACP link generation
PHPBB3-14039
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/config/installer/container/services_installer.yml | 1 | ||||
-rw-r--r-- | phpBB/phpbb/install/installer.php | 28 |
2 files changed, 12 insertions, 17 deletions
diff --git a/phpBB/config/installer/container/services_installer.yml b/phpBB/config/installer/container/services_installer.yml index 939dd225b9..10f9494aa1 100644 --- a/phpBB/config/installer/container/services_installer.yml +++ b/phpBB/config/installer/container/services_installer.yml @@ -86,6 +86,7 @@ services: abstract: true arguments: - @installer.helper.config + - @path_helper installer.install.module_collection: class: phpbb\di\ordered_service_collection diff --git a/phpBB/phpbb/install/installer.php b/phpBB/phpbb/install/installer.php index 8a0374b1f0..bdff62e0b1 100644 --- a/phpBB/phpbb/install/installer.php +++ b/phpBB/phpbb/install/installer.php @@ -21,6 +21,7 @@ use phpbb\install\exception\user_interaction_required_exception; use phpbb\install\helper\config; use phpbb\install\helper\iohandler\cli_iohandler; use phpbb\install\helper\iohandler\iohandler_interface; +use phpbb\path_helper; class installer { @@ -40,6 +41,11 @@ class installer protected $iohandler; /** + * @var string + */ + protected $web_root; + + /** * Stores the number of steps that a given module has * * @var array @@ -49,12 +55,14 @@ class installer /** * Constructor * - * @param config $config Installer config handler + * @param config $config Installer config handler + * @param path_helper $path_helper Path helper */ - public function __construct(config $config) + public function __construct(config $config, path_helper $path_helper) { $this->install_config = $config; $this->installer_modules = null; + $this->web_root = $path_helper->get_web_root_path(); } /** @@ -183,21 +191,7 @@ class installer else { global $SID; - - // Construct ACP url - $acp_url = $protocol = $this->install_config->get('server_protocol'); - $acp_url .= $this->install_config->get('server_name'); - $port = $this->install_config->get('server_port'); - - if (!((strpos($protocol, 'https:') === 0 && $port === 443) - || (strpos($protocol, 'http:') === 0 && $port === 80))) - { - $acp_url .= ':' . $port; - } - - $acp_url .= $this->install_config->get('script_path'); - $acp_url .= '/adm/index.php' . $SID; - + $acp_url = $this->web_root . '/adm/index.php' . $SID; $this->iohandler->add_success_message('INSTALLER_FINISHED', array( 'ACP_LINK', $acp_url, |