Skip to content

Commit

Permalink
Fixed a bug where URL routing didn't work for topic links without "in…
Browse files Browse the repository at this point in the history
…dex.php"
  • Loading branch information
mystralkk committed Nov 24, 2017
1 parent 9e51372 commit a29671d
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions system/lib-topic.php
Expand Up @@ -1569,17 +1569,26 @@ function TOPIC_getUrl($topicId)
{
global $_CONF;

if ($_CONF['url_rewrite']) {
$retval = COM_buildURL(
$_CONF['site_url'] . '/index.php?'
. http_build_query(array(
TOPIC_PLACEHOLDER => 'topic',
'topic' => $topicId,
))
);
} else {
$retval = $_CONF['site_url'] . '/index.php?'
. http_build_query(array('topic' => $topicId));
switch ($_CONF['url_routing']) {
case Router::ROUTING_WITH_INDEX_PHP:
$retval = COM_buildURL(
$_CONF['site_url'] . '/index.php?'
. http_build_query(array(
TOPIC_PLACEHOLDER => 'topic',
'topic' => $topicId,
))
);
break;

case Router::ROUTING_WITHOUT_INDEX_PHP:
$retval = $_CONF['site_url'] . '/topic/' . urlencode($topicId);
break;

case Router::ROUTING_DISABLED:
default:
$retval = $_CONF['site_url'] . '/index.php?'
. http_build_query(array('topic' => $topicId));
break;
}

return $retval;
Expand Down

0 comments on commit a29671d

Please sign in to comment.