aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/functions.php5
-rw-r--r--tests/bbcode/parser_test.php3
-rw-r--r--tests/bbcode/url_bbcode_test.php3
-rw-r--r--tests/functions/make_clickable_email_test.php5
-rw-r--r--tests/functions/make_clickable_test.php3
-rw-r--r--tests/text_formatter/s9e/factory_test.php6
6 files changed, 16 insertions, 9 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 6a36210dca..43d8cce3c4 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1644,7 +1644,7 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false,
*/
function generate_board_url($without_script_path = false)
{
- global $config, $user, $request;
+ global $config, $user, $request, $symfony_request;
$server_name = $user->host;
@@ -1661,7 +1661,8 @@ function generate_board_url($without_script_path = false)
}
else
{
- $server_port = $request->server('SERVER_PORT', 0);
+ $server_port = (int) $symfony_request->getPort();
+
$forwarded_proto = $request->server('HTTP_X_FORWARDED_PROTO');
if (!empty($forwarded_proto) && $forwarded_proto === 'https')
diff --git a/tests/bbcode/parser_test.php b/tests/bbcode/parser_test.php
index 4e85737c4f..b569d371f1 100644
--- a/tests/bbcode/parser_test.php
+++ b/tests/bbcode/parser_test.php
@@ -249,9 +249,10 @@ class phpbb_bbcode_parser_test extends \phpbb_test_case
$this->markTestIncomplete($incomplete);
}
- global $user, $request;
+ global $user, $request, $symfony_request;
$user = new phpbb_mock_user;
$request = new phpbb_mock_request;
+ $symfony_request = new \phpbb\symfony_request($request);
$bbcode = new bbcode_firstpass();
$bbcode->message = $message;
diff --git a/tests/bbcode/url_bbcode_test.php b/tests/bbcode/url_bbcode_test.php
index 3f8ad6022f..f95970a6bb 100644
--- a/tests/bbcode/url_bbcode_test.php
+++ b/tests/bbcode/url_bbcode_test.php
@@ -52,9 +52,10 @@ class phpbb_url_bbcode_test extends phpbb_test_case
*/
public function test_url($description, $message, $expected)
{
- global $user, $request;
+ global $user, $request, $symfony_request;
$user = new phpbb_mock_user;
$request = new phpbb_mock_request;
+ $symfony_request = new \phpbb\symfony_request($request);
$bbcode = new bbcode_firstpass();
$bbcode->message = $message;
diff --git a/tests/functions/make_clickable_email_test.php b/tests/functions/make_clickable_email_test.php
index f32b4339a8..d481bde80d 100644
--- a/tests/functions/make_clickable_email_test.php
+++ b/tests/functions/make_clickable_email_test.php
@@ -17,9 +17,10 @@ class phpbb_functions_make_clickable_email_test extends phpbb_test_case
{
parent::setUp();
- global $config, $user, $request;
+ global $config, $user, $request, $symfony_request;
$user = new phpbb_mock_user();
$request = new phpbb_mock_request();
+ $symfony_request = new \phpbb\symfony_request($request);
}
/**
@@ -168,7 +169,7 @@ class phpbb_functions_make_clickable_email_test extends phpbb_test_case
array('abc,def@example.com'), // invalid character ,
array('abc<def@example.com'), // invalid character <
array('abc>def@example.com', 'abc><!-- e --><a href="mailto:def@example.com">def@example.com</a><!-- e -->'), // invalid character >
-
+
// http://fightingforalostcause.net/misc/2006/compare-email-regex.php
array('missingDomain@.com'),
array('@missingLocal.org'),
diff --git a/tests/functions/make_clickable_test.php b/tests/functions/make_clickable_test.php
index 48fc2c19fb..a351a6d527 100644
--- a/tests/functions/make_clickable_test.php
+++ b/tests/functions/make_clickable_test.php
@@ -146,9 +146,10 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case
{
parent::setUp();
- global $config, $user, $request;
+ global $config, $user, $request, $symfony_request;
$user = new phpbb_mock_user();
$request = new phpbb_mock_request();
+ $symfony_request = new \phpbb\symfony_request($request);
}
/**
diff --git a/tests/text_formatter/s9e/factory_test.php b/tests/text_formatter/s9e/factory_test.php
index 82b1b0043b..fd9b4e4c09 100644
--- a/tests/text_formatter/s9e/factory_test.php
+++ b/tests/text_formatter/s9e/factory_test.php
@@ -34,7 +34,7 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case
public function get_factory($styles_path = null)
{
- global $config, $phpbb_root_path, $request, $user;
+ global $config, $phpbb_root_path, $request, $symfony_request, $user;
if (!isset($styles_path))
{
@@ -69,6 +69,7 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case
'server_protocol' => 'http://',
));
$request = new phpbb_mock_request;
+ $symfony_request = new \phpbb\symfony_request($request);
$user = new phpbb_mock_user;
return $factory;
@@ -152,7 +153,7 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case
public function test_local_url()
{
- global $config, $user, $request;
+ global $config, $user, $request, $symfony_request;
$config = new \phpbb\config\config(array(
'force_server_vars' => true,
'server_protocol' => 'http://',
@@ -163,6 +164,7 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case
));
$user = new phpbb_mock_user;
$request = new phpbb_mock_request;
+ $symfony_request = new \phpbb\symfony_request($request);
$fixture = __DIR__ . '/fixtures/local_url.xml';
$renderer = $this->get_test_case_helpers()->set_s9e_services(null, $fixture)->get('text_formatter.renderer');