protected void ProcessHtmlUrlTag(HtmlTagContextAttribute filterAttribute, HtmlWriter writer) { string value = filterAttribute.Value; AttachmentLink attachmentLink = this.IsInlineReference(value); if (attachmentLink != null) { this.OutputInlineReference(filterAttribute, attachmentLink, writer); return; } SafeHtmlCallback.TypeOfUrl typeOfUrl = SafeHtmlCallback.GetTypeOfUrl(filterAttribute.Value, filterAttribute.Id); if (typeOfUrl == SafeHtmlCallback.TypeOfUrl.Redirection) { filterAttribute.Write(); this.hasFoundRedirUrlInCurrentPass = true; return; } if (typeOfUrl == SafeHtmlCallback.TypeOfUrl.Trusted || typeOfUrl == SafeHtmlCallback.TypeOfUrl.Local) { filterAttribute.Write(); return; } if (typeOfUrl == SafeHtmlCallback.TypeOfUrl.Unknown) { writer.WriteAttribute(filterAttribute.Id, " "); } }
protected static bool IsSafeUrl(string urlString, HtmlAttributeId htmlAttr) { SafeHtmlCallback.TypeOfUrl typeOfUrl = SafeHtmlCallback.GetTypeOfUrl(urlString, htmlAttr); return(typeOfUrl != SafeHtmlCallback.TypeOfUrl.Unknown); }