From c368d170cf09d06ff63249d4405323e6108d90bb Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 8 Sep 2017 10:45:22 +0200 Subject: [ticket/15351] Makes confirm_works in a router context (app.php) PHPBB3-15351 --- phpBB/phpbb/path_helper.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'phpBB/phpbb/path_helper.php') diff --git a/phpBB/phpbb/path_helper.php b/phpBB/phpbb/path_helper.php index 154361ef64..5b6db35f23 100644 --- a/phpBB/phpbb/path_helper.php +++ b/phpBB/phpbb/path_helper.php @@ -496,4 +496,17 @@ class path_helper return $page; } + + /** + * Tells if the router is currently in use (if the current page is a route or not) + * + * @return bool + */ + public function is_router_used() + { + // Script name URI (e.g. phpBB/app.php) + $script_name = $this->symfony_request->getScriptName(); + + return basename($script_name) === 'app.' . $this->php_ext; + } } -- cgit v1.2.1