diff options
Diffstat (limited to 'phpBB/phpbb/controller')
-rw-r--r-- | phpBB/phpbb/controller/provider.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/controller/resolver.php | 18 |
2 files changed, 18 insertions, 2 deletions
diff --git a/phpBB/phpbb/controller/provider.php b/phpBB/phpbb/controller/provider.php index fffd4f0428..7e26848290 100644 --- a/phpBB/phpbb/controller/provider.php +++ b/phpBB/phpbb/controller/provider.php @@ -73,7 +73,7 @@ class provider $this->routes = new RouteCollection; foreach ($this->routing_files as $file_path) { - $loader = new YamlFileLoader(new FileLocator($base_path)); + $loader = new YamlFileLoader(new FileLocator(phpbb_realpath($base_path))); $this->routes->addCollection($loader->load($file_path)); } diff --git a/phpBB/phpbb/controller/resolver.php b/phpBB/phpbb/controller/resolver.php index efab34b701..948a6a218c 100644 --- a/phpBB/phpbb/controller/resolver.php +++ b/phpBB/phpbb/controller/resolver.php @@ -41,6 +41,12 @@ class resolver implements ControllerResolverInterface protected $template; /** + * Request 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)) { |