Hi,
I'm trying to figure something out with the Text/HTML module how it decides to inject the portal's upload directory into the HTML.
In version 3.3.0 of Text/HTML, a local private version of ManageUploadDirecory (in HtmlModule.ascx.vb) was used. The following IF statement was used to decide whether to inject the upload directory:
If InStr(1, strSRC,"://") = 0 And Left(strSRC, 1) <> "/" And strSRC.IndexOf(strUploadDirectory.Substring(strUploadDirectory.IndexOf("Portals/"))) = -1 Then
In version 4.6.1, it uses DotNetNuke.Common.Globals.ManageUploadDirectory which in turn calls DotNetNuke.Common.Globals.ManageTokenUploadDirectory (both in Globals.vb). The function is very similar, except that the IF statement it uses is:
If Not strURL.Contains("://") AndAlso Not strURL.Contains(_UploadDirectory) Then
Both versions check for URLs with the upload directory or a scheme, but the the Globals version doesn't check for URLs with an absolute path (that begins with "/"). Does anyoen know if this was an oversight when refactoring, or was this test removed for a specifig reason?
This is causing an issue for my portals, because we have some need to share collateral between portals. Basically, one portal has content with images that are in another portal's upload directory. We do this so we can maintain collateral masters that portal admins can't modify but can incorporate into their sites. For example, an HTML module on Portal ID 5 may link to images on Portal ID 6. Whenever we do this, we get URLs like "/portals/5/portals/6/..." What's even more frustrating is that the images look fine while we're editing the content. They only break when we view the module.
I'd love it if the absolute path check could be added to DotNetNuke.Common.Globals.ManageTokenUploadDirectory, so that it became something like:
If Not strURL.Contains("://") AndAlso Left(strURL, 1) <> "/" AndAlso Not strURL.Contains(_UploadDirectory) Then
Also, if someone knows a better place to bring this up, please let me know.
Thanks,
-Andrew Galbraith Ryer