This repository has been archived by the owner on Aug 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3bbd9a
commit 7d59b02
Showing
22 changed files
with
227 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
Sources/EPiServer.Reference.Commerce.Manager/IRIConfigurationModule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using EPiServer.Framework; | ||
using EPiServer.Framework.Initialization; | ||
using EPiServer.ServiceLocation; | ||
using EPiServer.Web; | ||
|
||
namespace EPiServer.Reference.Commerce.Manager | ||
{ | ||
// To support an extended range of characters (outside of what has been defined in RFC1738) in URLs, define UNICODE_CHARACTERS_IN_URL symbol - this should be done both in Commerce Manager and Front-end site. | ||
// More information about this feature: http://world.episerver.com/documentation/developer-guides/CMS/routing/internationalized-resource-identifiers-iris/ | ||
|
||
// The code block below will allow general Unicode letter characters. | ||
// To support more Unicode blocks, update the regular expression for ValidUrlCharacters. | ||
// For example, to support Thai Unicode block, add \p{IsThai} to it. | ||
// The supported Unicode blocks can be found here: https://msdn.microsoft.com/en-us/library/20bw873z(v=vs.110).aspx#Anchor_12 | ||
|
||
#if UNICODE_CHARACTERS_IN_URL | ||
[ModuleDependency(typeof(EPiServer.Web.InitializationModule))] | ||
public class IRIConfigurationModule : IConfigurableModule | ||
{ | ||
public void ConfigureContainer(ServiceConfigurationContext context) | ||
{ | ||
context.Services.RemoveAll<UrlSegmentOptions>(); | ||
context.Services.AddSingleton<UrlSegmentOptions>(s => new UrlSegmentOptions | ||
{ | ||
Encode = true, | ||
ValidUrlCharacters = @"\p{L}0-9\-_~\.\$" | ||
}); | ||
} | ||
|
||
public void Initialize(InitializationEngine context) | ||
{ } | ||
|
||
public void Uninitialize(InitializationEngine context) | ||
{ } | ||
} | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.