aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/controller
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-07-08 18:09:41 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-07-08 18:09:41 +0200
commit91f5d59f69f6257eed1bb86f43c35d614aa06533 (patch)
treea4d0dcac0d35e8b6ea221bf372fd371b00ae3758 /phpBB/phpbb/controller
parentdca8afcd6f7f867f729d0a2e55d4ae0d9a2961a3 (diff)
parentb4d7192b62c98b0738711a7b7647a47129adb902 (diff)
downloadforums-91f5d59f69f6257eed1bb86f43c35d614aa06533.tar
forums-91f5d59f69f6257eed1bb86f43c35d614aa06533.tar.gz
forums-91f5d59f69f6257eed1bb86f43c35d614aa06533.tar.bz2
forums-91f5d59f69f6257eed1bb86f43c35d614aa06533.tar.xz
forums-91f5d59f69f6257eed1bb86f43c35d614aa06533.zip
Merge pull request #2676 from Nicofuma/ticket/12787
[ticket/12787] Allow the route to say that the referer has to be used. * Nicofuma/ticket/12787: [ticket/12787] Updates phpbb_mock_controller_helper [ticket/12787] Add controller_helper::get_current_url() [ticket/12787] Remove one app.php when it's both in $path and $web_root_path [ticket/12787] Fix the absolute board url [ticket/12787] Use a parameter (_referer) instead of the Referer header [ticket/12099] Add unit tests for get_web_root_path_from_ajax_referer() [ticket/12099] Remove config again [ticket/12099] Correctly fix the path when performing AJAX requests [ticket/12099] Add request argument to path_helper service
Diffstat (limited to 'phpBB/phpbb/controller')
-rw-r--r--phpBB/phpbb/controller/helper.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php
index 930bc42a98..e330fb5b6d 100644
--- a/phpBB/phpbb/controller/helper.php
+++ b/phpBB/phpbb/controller/helper.php
@@ -40,6 +40,9 @@ class helper
*/
protected $config;
+ /* @var \phpbb\symfony_request */
+ protected $symfony_request;
+
/**
* phpBB root path
* @var string
@@ -60,14 +63,16 @@ class helper
* @param \phpbb\config\config $config Config object
* @param \phpbb\controller\provider $provider Path provider
* @param \phpbb\extension\manager $manager Extension manager object
+ * @param \phpbb\symfony_request $symfony_request Symfony Request object
* @param string $phpbb_root_path phpBB root path
* @param string $php_ext PHP extension
*/
- public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, $phpbb_root_path, $php_ext)
+ public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, \phpbb\symfony_request $symfony_request, $phpbb_root_path, $php_ext)
{
$this->template = $template;
$this->user = $user;
$this->config = $config;
+ $this->symfony_request = $symfony_request;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$provider->find_routing_files($manager->get_finder());
@@ -151,4 +156,14 @@ class helper
return $this->render('message_body.html', $this->user->lang('INFORMATION'), $code);
}
+
+ /**
+ * Return the current url
+ *
+ * @return string
+ */
+ public function get_current_url()
+ {
+ return generate_board_url(true) . $this->symfony_request->getRequestUri();
+ }
}