aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2014-09-17 00:57:34 +0200
committerMarc Alexander <admin@m-a-styles.de>2014-09-17 00:57:34 +0200
commitf6ccb3078147a205ec447ae500579d6efe70d15c (patch)
tree3b1c5c2bec1f50a36518c989a33adf847b308a7d /phpBB/phpbb
parent5fa2d197566c0f443bbdd71101b6c7876158dea6 (diff)
parent20903c0a9b0bc2df65feca467a2e318e700a9b8a (diff)
downloadforums-f6ccb3078147a205ec447ae500579d6efe70d15c.tar
forums-f6ccb3078147a205ec447ae500579d6efe70d15c.tar.gz
forums-f6ccb3078147a205ec447ae500579d6efe70d15c.tar.bz2
forums-f6ccb3078147a205ec447ae500579d6efe70d15c.tar.xz
forums-f6ccb3078147a205ec447ae500579d6efe70d15c.zip
Merge branch 'develop-ascraeus' into develop
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/controller/helper.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php
index e5e54fac00..e2932086db 100644
--- a/phpBB/phpbb/controller/helper.php
+++ b/phpBB/phpbb/controller/helper.php
@@ -15,6 +15,7 @@ namespace phpbb\controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Generator\UrlGenerator;
+use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\RequestContext;
/**
@@ -115,10 +116,11 @@ class helper
* @param string $route Name of the route to travel
* @param array $params String or array of additional url parameters
* @param bool $is_amp Is url using &amp; (true) or & (false)
- * @param string|bool $session_id Possibility to use a custom session id instead of the global one
+ * @param string|bool $session_id Possibility to use a custom session id instead of the global one
+ * @param bool|string $reference_type The type of reference to be generated (one of the constants)
* @return string The URL already passed through append_sid()
*/
- public function route($route, array $params = array(), $is_amp = true, $session_id = false)
+ public function route($route, array $params = array(), $is_amp = true, $session_id = false, $reference_type = UrlGeneratorInterface::ABSOLUTE_PATH)
{
$anchor = '';
if (isset($params['#']))
@@ -146,13 +148,18 @@ class helper
$context->setBaseUrl($base_url);
$url_generator = new UrlGenerator($this->route_collection, $context);
- $route_url = $url_generator->generate($route, $params);
+ $route_url = $url_generator->generate($route, $params, $reference_type);
if ($is_amp)
{
$route_url = str_replace(array('&amp;', '&'), array('&', '&amp;'), $route_url);
}
+ if ($reference_type === UrlGeneratorInterface::RELATIVE_PATH && empty($this->config['enable_mod_rewrite']))
+ {
+ $route_url = 'app.' . $this->php_ext . '/' . $route_url;
+ }
+
return append_sid($route_url . $anchor, false, $is_amp, $session_id, true);
}