aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/controller
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-08-08 17:07:19 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-08-08 17:15:01 +0200
commit558aff46cd7a94ad6c00bd2c8b4a4fa0b99ba8a9 (patch)
tree19344b7f6491b4652c092b8eb2c93bfa7c36f48e /phpBB/phpbb/controller
parentf6da2661091a9f068956a23df7e70450cec9ee74 (diff)
downloadforums-558aff46cd7a94ad6c00bd2c8b4a4fa0b99ba8a9.tar
forums-558aff46cd7a94ad6c00bd2c8b4a4fa0b99ba8a9.tar.gz
forums-558aff46cd7a94ad6c00bd2c8b4a4fa0b99ba8a9.tar.bz2
forums-558aff46cd7a94ad6c00bd2c8b4a4fa0b99ba8a9.tar.xz
forums-558aff46cd7a94ad6c00bd2c8b4a4fa0b99ba8a9.zip
[ticket/security-155] Cast the types of string values in the controller routes
SECURITY-155
Diffstat (limited to 'phpBB/phpbb/controller')
-rw-r--r--phpBB/phpbb/controller/resolver.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/phpBB/phpbb/controller/resolver.php b/phpBB/phpbb/controller/resolver.php
index efab34b701..02b08a2847 100644
--- a/phpBB/phpbb/controller/resolver.php
+++ b/phpBB/phpbb/controller/resolver.php
@@ -41,6 +41,12 @@ class resolver implements ControllerResolverInterface
protected $template;
/**
+ * Requst type cast helper object
+ * @var \phpbb\request\type_cast_helper
+ */
+ protected $type_cast_helper;
+
+ /**
* phpBB root path
* @var string
*/
@@ -59,6 +65,7 @@ class resolver implements ControllerResolverInterface
$this->user = $user;
$this->container = $container;
$this->template = $template;
+ $this->type_cast_helper = new \phpbb\request\type_cast_helper();
$this->phpbb_root_path = $phpbb_root_path;
}
@@ -138,7 +145,16 @@ class resolver implements ControllerResolverInterface
{
if (array_key_exists($param->name, $attributes))
{
- $arguments[] = $attributes[$param->name];
+ if (is_string($attributes[$param->name]))
+ {
+ $value = $attributes[$param->name];
+ $this->type_cast_helper->set_var($value, $attributes[$param->name], 'string', true, false);
+ $arguments[] = $value;
+ }
+ else
+ {
+ $arguments[] = $attributes[$param->name];
+ }
}
else if ($param->getClass() && $param->getClass()->isInstance($request))
{