mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-15 13:14:09 +02:00
Merge pull request #2092 from nickvergessen/ticket/12090
[ticket/12090] Pass route name to url() instead of the url itself
This commit is contained in:
@@ -17,3 +17,15 @@ foo_exception_controller:
|
||||
foo_redirect_controller:
|
||||
pattern: /foo/redirect
|
||||
defaults: { _controller: foo_bar.controller:redirect }
|
||||
|
||||
foo_index_controller:
|
||||
pattern: /index
|
||||
defaults: { _controller: foo_bar.controller:redirect }
|
||||
|
||||
foo_tests_index_controller:
|
||||
pattern: /tests/index
|
||||
defaults: { _controller: foo_bar.controller:redirect }
|
||||
|
||||
foo_tests_dotdot_index_controller:
|
||||
pattern: /tests/../index
|
||||
defaults: { _controller: foo_bar.controller:redirect }
|
||||
|
@@ -63,40 +63,19 @@ class controller
|
||||
'tests/index.php',
|
||||
),
|
||||
array(
|
||||
$this->helper->url('index'),
|
||||
$this->helper->route('foo_index_controller'),
|
||||
$rewrite_prefix . 'index',
|
||||
),
|
||||
array(
|
||||
$this->helper->url('tests/index'),
|
||||
$this->helper->route('foo_tests_index_controller'),
|
||||
$rewrite_prefix . 'tests/index',
|
||||
),
|
||||
/**
|
||||
* Symfony does not allow /../ in routes
|
||||
array(
|
||||
$this->helper->url('tests/../index'),
|
||||
$this->helper->route('foo_tests_dotdot_index_controller'),
|
||||
$rewrite_prefix . 'index',
|
||||
),
|
||||
/*
|
||||
// helper URLs starting with ../ are prone to failure.
|
||||
// Do not test them right now.
|
||||
array(
|
||||
$this->helper->url('../index'),
|
||||
'../index',
|
||||
),
|
||||
array(
|
||||
$this->helper->url('../../index'),
|
||||
'../index',
|
||||
),
|
||||
array(
|
||||
$this->helper->url('../tests/index'),
|
||||
$rewrite_prefix . '../tests/index',
|
||||
),
|
||||
array(
|
||||
$this->helper->url('../tests/../index'),
|
||||
'../index',
|
||||
),
|
||||
array(
|
||||
$this->helper->url('../../tests/index'),
|
||||
'../tests/index',
|
||||
),
|
||||
*/
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user