예제 #1
0
 //根据发布系统属性判断是否为相对路径并返回解析后路径
 public static string ParseNavigationUrl(PublishmentSystemInfo publishmentSystemInfo, string url, bool isFromBackground)
 {
     if (publishmentSystemInfo != null)
     {
         if (!string.IsNullOrEmpty(url) && url.StartsWith("@"))
         {
             var extensionName = PathUtils.GetExtension(url).ToLower();
             //如果设置编辑器上传文件URL前缀,排除单页html,只允许file,image,video
             if ((url.StartsWith("@/upload") || url.StartsWith("/upload") || url.StartsWith("@\\upload") || url.StartsWith("\\upload")) &&
                 !string.IsNullOrEmpty(publishmentSystemInfo.Additional.EditorUploadFilePre) &&
                 (PathUtility.IsImageExtenstionAllowed(publishmentSystemInfo, extensionName) ||
                  PathUtility.IsFileExtenstionAllowed(publishmentSystemInfo, extensionName) ||
                  PathUtility.IsVideoExtenstionAllowed(publishmentSystemInfo, extensionName)))
             {
                 /****获取编辑器中内容,解析@符号,添加了远程路径处理 20151103****/
                 return(GetPublishmentSystemUrlForEditorUploadFilePre(publishmentSystemInfo, url.Substring(1), isFromBackground));
             }
             return(GetPublishmentSystemUrl(publishmentSystemInfo, url.Substring(1), isFromBackground));
         }
         return(PageUtils.ParseNavigationUrl(url, WebConfigUtils.ApplicationPath));
     }
     return(PageUtils.ParseNavigationUrl(url));
 }