Commit c48029c6 authored by rjsmelo's avatar rjsmelo

[bp/r65935][FIX] Fix issue when custum routes have / in the route, remove...

[bp/r65935][FIX] Fix issue when custum routes have / in the route, remove unused field in custom routes.
parent 6dc64874
......@@ -1991,6 +1991,7 @@ installer/schema/20171123_create_object_links_tiki.php -text
installer/schema/20171129_backlinks_for_object_types_admin_options_tiki.sql -text
installer/schema/20171130_plugin_include_link_original_tiki.sql -text
installer/schema/20171204_update_geo_enabled_tiki.sql -text
installer/schema/20180405_remove_unused_user_id_tiki.sql -text
installer/schema/999999991_decode_pages_sources_tiki.php -text
installer/schema/99999999_image_plugins_kill_tiki.php -text
installer/schema/index.php -text
......
......@@ -634,8 +634,7 @@ CREATE TABLE `tiki_custom_route` (
`type` varchar(255) NOT NULL,
`from` varchar(255) NOT NULL,
`redirect` text NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '1',
`user_id` int(11) NOT NULL
`active` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE=MyISAM;
DROP TABLE IF EXISTS `tiki_directory_categories`;
......
ALTER TABLE tiki_custom_route DROP COLUMN `user_id`;
......@@ -119,6 +119,8 @@ class Item
{
global $tikilib;
switch ($this->type) {
case 'Direct':
if ($path === $this->from) {
......@@ -148,7 +150,9 @@ class Item
require_once('tiki-sefurl.php');
$smarty = TikiLib::lib('smarty');
$smarty->loadPlugin('smarty_modifier_sefurl');
$isExternal = TikiLib::setExternalContext(true);
$url = smarty_modifier_sefurl($objectId, $type);
TikiLib::setExternalContext($isExternal);
return $url;
}
......@@ -174,7 +178,14 @@ class Item
return false;
}
return 'item' . $itemId;
require_once('tiki-sefurl.php');
$smarty = TikiLib::lib('smarty');
$smarty->loadPlugin('smarty_modifier_sefurl');
$isExternal = TikiLib::setExternalContext(true);
$url = smarty_modifier_sefurl($itemId, 'trackeritem');
TikiLib::setExternalContext($isExternal);
return $url;
break;
default:
......
......@@ -5475,7 +5475,11 @@ class TikiLib extends TikiDb_Bridge
static function setExternalContext($isExternal)
{
$oldValue = self::$isExternalContext;
self::$isExternalContext = (bool) $isExternal;
return $oldValue;
}
static function contextualizeKey($key, $param1 = null, $param2 = null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment