コード例 #1
0
        private string GetCleanPath(string path, FriendlyUrlSettings friendlyUrlSettings)
        {
            if (string.IsNullOrEmpty(path))
            {
                return(path);
            }

            var urlPath = path.TrimStart('/');

            urlPath = UrlRewriterUtils.CleanExtension(urlPath, friendlyUrlSettings, string.Empty);

            return(string.Format("/{0}", urlPath));
        }
コード例 #2
0
        public string CleanTabUrl(string url)
        {
            if (string.IsNullOrEmpty(url))
            {
                return(url);
            }

            var  urlPath = url.TrimStart('/');
            bool modified;

            var portalSettings      = PortalController.Instance.GetCurrentPortalSettings();
            var friendlyUrlSettings = new FriendlyUrlSettings(portalSettings.PortalId);

            urlPath = UrlRewriterUtils.CleanExtension(urlPath, friendlyUrlSettings, string.Empty);

            //Clean Url
            var options = UrlRewriterUtils.ExtendOptionsForCustomURLs(UrlRewriterUtils.GetOptionsFromSettings(friendlyUrlSettings));

            urlPath = FriendlyUrlController.CleanNameForUrl(urlPath, options, out modified);

            return('/' + urlPath);
        }