diff options
| author | Nils Adermann <naderman@naderman.de> | 2011-08-18 19:15:00 -0400 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2011-08-18 19:15:00 -0400 |
| commit | 052e33823b98ec3e51fdb424937e72dd1f33d11f (patch) | |
| tree | 975749ed51ac43c98940b7dd7b0ed03a9f99d7a6 /phpBB/install/install_install.php | |
| parent | d06dcd69e60bc3e6eafb4a11dfb1639fa4e4646b (diff) | |
| parent | b05382d226d2c5d68ff5a483d8885f65e754c90d (diff) | |
| download | forums-052e33823b98ec3e51fdb424937e72dd1f33d11f.tar forums-052e33823b98ec3e51fdb424937e72dd1f33d11f.tar.gz forums-052e33823b98ec3e51fdb424937e72dd1f33d11f.tar.bz2 forums-052e33823b98ec3e51fdb424937e72dd1f33d11f.tar.xz forums-052e33823b98ec3e51fdb424937e72dd1f33d11f.zip | |
Merge remote-tracking branch 'github-igorw/feature/request-class' into develop
* github-igorw/feature/request-class:
[feature/request-class] Fix session_testable_factory
[feature/request-class] Adjust code base to do html decoding manually
[feature/request-class] Remove $html_encode arg, force manual decoding
[feature/request-class] Do not html escape user agent in header_filename
[feature/request-class] Make use of the is_secure() method
[feature/request-class] Add is_secure method to request for HTTPS
[feature/request-class] Make server() use the $html_encode parameter
[feature/request-class] Remove useless condition
[feature/request-class] Minor spacing CS adjustments
[feature/request-class] Add server(), header() and is_ajax() to request
Diffstat (limited to 'phpBB/install/install_install.php')
| -rw-r--r-- | phpBB/install/install_install.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index e36fc1c618..1a69638220 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -999,7 +999,7 @@ class install_install extends module */ function obtain_advanced_settings($mode, $sub) { - global $lang, $template, $phpEx; + global $lang, $template, $phpEx, $request; $this->page_title = $lang['STAGE_ADVANCED']; @@ -1017,7 +1017,7 @@ class install_install extends module $s_hidden_fields .= '<input type="hidden" name="language" value="' . $data['language'] . '" />'; // HTTP_HOST is having the correct browser url in most cases... - $server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); + $server_name = strtolower(htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME')))); // HTTP HOST can carry a port number... if (strpos($server_name, ':') !== false) @@ -1027,16 +1027,16 @@ class install_install extends module $data['email_enable'] = ($data['email_enable'] !== '') ? $data['email_enable'] : true; $data['server_name'] = ($data['server_name'] !== '') ? $data['server_name'] : $server_name; - $data['server_port'] = ($data['server_port'] !== '') ? $data['server_port'] : ((!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT')); - $data['server_protocol'] = ($data['server_protocol'] !== '') ? $data['server_protocol'] : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://'); - $data['cookie_secure'] = ($data['cookie_secure'] !== '') ? $data['cookie_secure'] : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? true : false); + $data['server_port'] = ($data['server_port'] !== '') ? $data['server_port'] : $request->server('SERVER_PORT', 0); + $data['server_protocol'] = ($data['server_protocol'] !== '') ? $data['server_protocol'] : ($request->is_secure() ? 'https://' : 'http://'); + $data['cookie_secure'] = ($data['cookie_secure'] !== '') ? $data['cookie_secure'] : $request->is_secure(); if ($data['script_path'] === '') { - $name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF'); + $name = htmlspecialchars_decode($request->server('PHP_SELF')); if (!$name) { - $name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI'); + $name = htmlspecialchars_decode($request->server('REQUEST_URI')); } // Replace backslashes and doubled slashes (could happen on some proxy setups) @@ -1101,7 +1101,7 @@ class install_install extends module */ function load_schema($mode, $sub) { - global $db, $lang, $template, $phpbb_root_path, $phpEx; + global $db, $lang, $template, $phpbb_root_path, $phpEx, $request; $this->page_title = $lang['STAGE_CREATE_TABLE']; $s_hidden_fields = ''; @@ -1117,8 +1117,8 @@ class install_install extends module } // HTTP_HOST is having the correct browser url in most cases... - $server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); - $referer = (!empty($_SERVER['HTTP_REFERER'])) ? strtolower($_SERVER['HTTP_REFERER']) : getenv('HTTP_REFERER'); + $server_name = strtolower(htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME')))); + $referer = strtolower($request->header('Referer')); // HTTP HOST can carry a port number... if (strpos($server_name, ':') !== false) @@ -1235,7 +1235,7 @@ class install_install extends module $current_time = time(); - $user_ip = (!empty($_SERVER['REMOTE_ADDR'])) ? phpbb_ip_normalise($_SERVER['REMOTE_ADDR']) : ''; + $user_ip = $request->server('REMOTE_ADDR') ? phpbb_ip_normalise($request->server('REMOTE_ADDR')) : ''; if ($data['script_path'] !== '/') { |
