Vulnerability in EPiServer.Forms
Hey, I'm trying to get a page from TinyMCE content URL-s. Sometimes, the HTML code for them is ie. "/link/5e2e383dc27944599568d46b085d62d2.aspx" and sometimes, URL is a an Edit mode URL, ie. /EPiServer/CMS/Content/om-fonus/demo-page,,124/. It seems that the edit-mode URL is displayed on page load, but once you change the page selection, you get the /link/xxxx.aspx.
The following code works for the classic link, but not in the case of edit-mode:
public static PageData GetPageFromClassicUrl(string classicUrl)
if (PermanentLinkMapStore.TryToMapped(classicUrl, out linkUrl))
var pageReference = PageReference.ParseUrl(linkUrl);
var page = DataFactory.Instance.GetPage(pageReference, LanguageSelector.AutoDetect());
Does anyone know how to get the page from the latter (edit-mode) or should I parse the string and get the ID between a comma and a slash?
I have not tried this myself but could you not use UrlResolver.Route(UrlBuilder, ContextMode.Edit)? I think it should handle both url formats.