Add exclusion list for modules like socialxe

This commit is contained in:
Kijin Sung 2020-06-21 17:49:33 +09:00
parent e9bec851f9
commit 075f1d935d

View file

@ -54,6 +54,13 @@ class Router
), ),
); );
/**
* List of legacy modules whose URLs should not be shortened.
*/
protected static $_except_modules = array(
'socialxe' => true,
);
/** /**
* Internal cache for module and route information. * Internal cache for module and route information.
*/ */
@ -353,8 +360,11 @@ class Router
} }
// Try the generic mid/act pattern. // Try the generic mid/act pattern.
self::$_route_cache[$keys_string] = '$' . $prefix_type . '/$act'; if ($prefix_type !== 'module' || !isset(self::$_except_modules[$args[$prefix_type]]))
return $args[$prefix_type] . '/' . $args['act'] . (count($args2) ? ('?' . http_build_query($args2)) : ''); {
self::$_route_cache[$keys_string] = '$' . $prefix_type . '/$act';
return $args[$prefix_type] . '/' . $args['act'] . (count($args2) ? ('?' . http_build_query($args2)) : '');
}
} }
// Try registered global routes. // Try registered global routes.