Underscores not handled properly in blog post URL

rated by 0 users
This post has 15 Replies | 3 Followers

Top 200 Contributor
Posts 116
Points 1,535
clarkrb [^o)] [^o)] Posted: Mon, Feb 11 2008 9:20 AM

If you enter underscores in the Post URL field on the Advanced Options tab of a blog post ( example: "sample_blog_post" ), the resulting URL is not as you entered it. The underscores show up in the URL as "_5F00_". ( example: "sample_5F00_blog_5F00_post.aspx" )

Top 10 Contributor
Posts 3,424
Points 65,610
CS Developers
Ben Tiedt replied on Mon, Feb 11 2008 9:29 AM

The underscore is used as the encoding sequence prefix for non-alphanumeric characters.  An underscore must be encoded... its encoding is _5F00_.

I would suggest using spaces instead of underscores.

Ben Tiedt's Blog

  • | Post Points: 20
Top 200 Contributor
Posts 116
Points 1,535
clarkrb replied on Mon, Feb 11 2008 9:53 AM

So this means that if I'm migrating from another platform that uses underscores in the URL, I'm going to need to do some kind of URL redirection for 650+ blog posts?

  • | Post Points: 20
Top 10 Contributor
Posts 3,424
Points 65,610
CS Developers
Ben Tiedt replied on Mon, Feb 11 2008 10:29 AM

Unfortunately, the post "slug" or "name" cannot contain all characters (URLs and ASP.Net do not support using all characters and URL encoding does not support unicode).  To avoid issues, CS uses a unicode-supporting encoding mechanism that uses the underscore as the encoding prefix.  Because of this, yes, a redirection would be required.

The escape pattern is _(?:[0-9a-f]{4})+_ ... an underscore, followed by sets of four hexadecimal characters, followed by an underscore.  Any underscore not matching this pattern could be converted to a space, for example, before being directed to CS for processing.

 

Ben Tiedt's Blog

  • | Post Points: 20
Not Ranked
Posts 8
Points 145
zj4x4 replied on Wed, Sep 3 2008 6:53 PM

So how can this be corrected?  We're using Live Writer for publishing and it always appends and underscore and a number to the image file name.  As a result, all images links have to be manually updated since CS tells Live Writer that the image address is name_F500_2.png when the file is stored in the file system as name_2.png.  This is from a network trace:

Live Writer to CS:

<string>WindowsLiveWriter/test5_11264/image_2.png</string>

Response from CS:

<string>http://domain.com/cs/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/mike/image_5F00_2.png</string>

It stores it in the file system as:

C:\Program Files (x86)\Telligent\Community Server 2008\Web\filestorage\CommunityServer.Blogs.Components.WeblogFiles\<user>\image_2.png

If it stored it in the file system with the 5F00 in the middle it would be fine.

  • | Post Points: 20
Top 10 Contributor
Posts 3,424
Points 65,610
CS Developers

zj4x4:
So how can this be corrected? 

What is the issue?  That these images do not show when viewed on the site or that the images are not uploaded properly or something else?

The escape sequence is correct and these images should be shown when viewing the site.

Ben Tiedt's Blog

  • | Post Points: 20
Not Ranked
Posts 8
Points 145
zj4x4 replied on Thu, Sep 4 2008 10:34 AM

Let's say I have an image named my_product.png.  I create a post that includes this file.  My publishing software, Live Writer in this case, uploads my_product.png to the CS filstorage area as expected and it is saved as my_product.png in the file system.  All is well except that the link reflected in the post once it's published is my_F500_product.png.  As a result, the image is broken.

Make sense?

  • | Post Points: 20
Top 10 Contributor
Posts 3,424
Points 65,610
CS Developers

zj4x4:
All is well except that the link reflected in the post once it's published is my_F500_product.png.

This *is* the correct URL.  This is not a direct file reference, it is processed through the CS2008+ centralized file system (CFS).   The CFS requires the URL to be encoded in this way.

I've tested this same situation locally and it is correct.  The file in the post should have the _F500_ replacement for underbars.

Do other files uploaded into your blog or media gallery function properly?  It may be an issue with CFS-stored files on your CS isntallation.

Ben Tiedt's Blog

  • | Post Points: 20
Not Ranked
Posts 8
Points 145
zj4x4 replied on Fri, Sep 5 2008 2:13 PM

Ok, I understand.  File uploads don't work for us either now that you mention it.  We don't use that feature as much, so we hadn't noticed.  Is there a process to fix this?

  • | Post Points: 20
Top 10 Contributor
Posts 3,424
Points 65,610
CS Developers
  1. Make sure that you're using IIS as your web server (Community Server does not support Cassini or the development web server included with Visual Studio)
  2. Ensure that the "Network Service" account (or whichever account the ASP.Net process is executed as) has full permissions to the filestorage/ folder in the web/ folder of your Community Server installation.
  3. If you are using IIS 7, ensure that Community Server is executed in "managed pipeline" mode.

If none of these help, let me know.

Ben Tiedt's Blog

  • | Post Points: 20
Not Ranked
Posts 8
Points 145
zj4x4 replied on Fri, Sep 5 2008 2:28 PM

Just verified that all that is the case.  This is running on IIS (64 bit) in managed pipeline mode and Network Service already had full control over filestorage.

Thanks for the help - let me know what else I should check.

  • | Post Points: 20
Top 10 Contributor
Posts 3,424
Points 65,610
CS Developers

Are there files in your filestorage/ folder?

If you attempt to upload a file through your profile ("My Files" area), does it work?  If you get an error, could you disable friendly error messages in your web.config file and let post the full error message?

Ben Tiedt's Blog

  • | Post Points: 20
Not Ranked
Posts 8
Points 145
zj4x4 replied on Sun, Sep 7 2008 9:37 AM

Uploads always complete successfully and are saved properly in the filestorage area.  However, the link that is generated results in a 404.

  • | Post Points: 20
Top 10 Contributor
Posts 3,424
Points 65,610
CS Developers
Ben Tiedt replied on Mon, Sep 8 2008 12:34 PM

zj4x4:

Uploads always complete successfully and are saved properly in the filestorage area.  However, the link that is generated results in a 404.

Is this site publicly viewable?  If so, could you send me the URL and a temporary user account to review a page that exposes this issue?

You can send this information in a private conversation.

Ben Tiedt's Blog

  • | Post Points: 20
Not Ranked
Posts 8
Points 145
zj4x4 replied on Mon, Sep 8 2008 3:44 PM

Just sent you a message via getben.com.  E-mail and conversations via the Contact link in the thread are not working - e-mail page comes up blank and conversation gives an error when you click send.

  • | Post Points: 5
Page 1 of 2 (16 items) 1 2 Next > | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com