aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/security/redirect.php9
-rw-r--r--tests/template/template.php6
2 files changed, 14 insertions, 1 deletions
diff --git a/tests/security/redirect.php b/tests/security/redirect.php
index 88e8e3d0a9..2474d62355 100644
--- a/tests/security/redirect.php
+++ b/tests/security/redirect.php
@@ -19,6 +19,14 @@ define('PHP_EXT', 'php');
require_once '../phpBB/includes/functions.php';
require_once '../phpBB/includes/session.php';
+if (!isset($config))
+{
+ $config = array();
+}
+$config += array(
+ 'force_server_vars' => 0,
+);
+
class phpbb_security_redirect_test extends PHPUnit_Extensions_OutputTestCase
{
protected $error_triggered = false;
@@ -28,6 +36,7 @@ class phpbb_security_redirect_test extends PHPUnit_Extensions_OutputTestCase
// array(Input -> redirect(), expected triggered error (else false), expected returned result url (else false))
return array(
array('data://x', false, 'http://localhost/phpBB'),
+ array('bad://localhost/phpBB/index.php', 'Tried to redirect to potentially insecure url.', false),
array('http://www.otherdomain.com/somescript.php', false, 'http://localhost/phpBB'),
array("http://localhost/phpBB/memberlist.php\n\rConnection: close", 'Tried to redirect to potentially insecure url.', false),
array('javascript:test', false, 'http://localhost/phpBB/../tests/javascript:test'),
diff --git a/tests/template/template.php b/tests/template/template.php
index 0639e263bb..c9a083ae68 100644
--- a/tests/template/template.php
+++ b/tests/template/template.php
@@ -18,7 +18,11 @@ require_once '../phpBB/includes/constants.php';
require_once '../phpBB/includes/functions.php';
require_once '../phpBB/includes/template.php';
-$config = array(
+if (!isset($config))
+{
+ $config = array();
+}
+$config += array(
'load_tplcompile' => true
);