Skip to content

Commit a79b7bd

Browse files
Validate and alter sename if it could be interpreted as SEO code
1 parent 2917779 commit a79b7bd

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/Libraries/SmartStore.Services/Seo/SeoExtensions.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using SmartStore.Core.Infrastructure;
1010
using SmartStore.Services.Localization;
1111
using SmartStore.Utilities;
12+
using SmartStore.Core.Localization;
1213

1314
namespace SmartStore.Services.Seo
1415
{
@@ -242,6 +243,15 @@ public static string ValidateSeName<T>(this T entity,
242243
}
243244
}
244245

246+
// validate and alter sename if it could be interpreted as SEO code
247+
if (LocalizationHelper.IsValidCultureCode(seName))
248+
{
249+
if (seName.Length == 2)
250+
{
251+
seName = seName + "-0";
252+
}
253+
}
254+
245255
// ensure this sename is not reserved yet
246256
string entityName = typeof(T).Name;
247257
int i = 2;

0 commit comments

Comments
 (0)