Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  HTML / Text Mo...  Absolute path check in Globals.ManageTokenUploadDirectory?
Previous Previous
 
Next Next
New Post 2/7/2008 7:59 AM
User is offline Andrew Galbraith Ryer
56 posts
10th Ranked




Absolute path check in Globals.ManageTokenUploadDirectory? 

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


-Drew
That's AC current for ya!
 
New Post 2/7/2008 8:21 AM
User is offline Andrew Galbraith Ryer
56 posts
10th Ranked




Re: Absolute path check in Globals.ManageTokenUploadDirectory? 

 

Actually, were one to modify that line, I like this better:

If Not strURL.Contains("://") AndAlso Not strURL.StartsWith("/") AndAlso Not strURL.Contains(_UploadDirectory) Then

-Drew
That's AC current for ya!
 
New Post 2/8/2008 6:48 AM
User is offline Don Worthley
213 posts
www.itcrossing.com
9th Ranked




Re: Absolute path check in Globals.ManageTokenUploadDirectory? 

Hi Andrew,

Wow, you're digging down into the bowels of DNN.  I like that.  A great place to add something like this would be at support.dotnetnuke.com.  This is where the project team members keep track of feature requests and they aways appreciate it when you add a request with code and an explanation as you have done.

All the best,

Don



Don Worthley
MCT, MCSD.NET, MCDBA, MCSE
Software Architect
IT Crossing Logo

Try metaPost today! Adding Web 2.0 Styled Content is Fun and Easy.
 
New Post 2/8/2008 8:17 AM
User is offline Sebastian Leupold
13708 posts
www.deutschnetnuke.de
1st Ranked












Re: Absolute path check in Globals.ManageTokenUploadDirectory? 

 Andrew Galbraith Ryer wrote

Actually, were one to modify that line, I like this better:

If Not strURL.Contains("://") AndAlso Not strURL.StartsWith("/") AndAlso Not strURL.Contains(_UploadDirectory) Then

Andrew,

there are a few issues to keep in mind, I will try to take care of it for next version.


Sebastian Leupold

DeutschNetNuke dnnWerk - The DotNetNuke Experts German DotNetNuke User-Group

DotNetNuke Project UserDefinedTable
DotNetNuke Project Release Tracker
 
New Post 2/8/2008 11:29 AM
User is offline Andrew Galbraith Ryer
56 posts
10th Ranked




Re: Absolute path check in Globals.ManageTokenUploadDirectory? 

Thanks Don! I searched around support.dotnetnuke.com before I posted this, just in case someone had posted the rationale for removing the check. At your suggestion, I've gone ahead and posted this as an issue.


-Drew
That's AC current for ya!
 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  HTML / Text Mo...  Absolute path check in Globals.ManageTokenUploadDirectory?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Digicon: DotNetNuke design and development
Digicon is based in Brisbane, Queensland, Australia
digicon.com.au
Live Visitor Tracking & Live Chat For DotNetNuke
Track your visitors in real time and add live chat for sales & support. Free Trial.
www.whoson.com
SINA101
WANT A SPECial sIte iN TAIWAN?
sina101.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP