Custom Module Url is accepting wierd characters

Posted by Community Admin on 04-Aug-2018 12:06

Custom Module Url is accepting wierd characters

All Replies

Posted by Community Admin on 13-Jun-2012 00:00

I'm noticing the generated urls for some of our resources are containing periods...where is it that I can tell it to filter those out?

Posted by Community Admin on 14-Jun-2012 00:00

Hello Steve,

I suspect that you creating your items using code. If your items are created using Sitefinity UI their URLs are set correctly but when creating items using code you should add the following:

private const string UrlNameCharsToReplace = @"[^\w\-\!\$\'\(\)\=\@\d_]+";
private const string UrlNameReplaceString = "-";
 
item.SetValue("UrlName", new Lstring(Regex.Replace(artistName, UrlNameCharsToReplace, UrlNameReplaceString)));

Greetings,
Stoimen Stoimenov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 14-Jun-2012 00:00

Nope, everything is created in the backend UI.  The guy entering the items put periods in the title like this (minus the quotes)

Group 30. Article 5.

...and the resulting URL has periods on those places :/

(5.0 SP1)


Posted by Community Admin on 18-Jun-2012 00:00

FYI I was also just able to make a blog post (not custom module) and it put periods in the URL

This thread is closed