Fixes the null PublishName problem, ensures the quey strings are not replaced when selecting a doc type

This commit is contained in:
Shannon
2018-05-02 15:35:26 +10:00
parent 9843f3a5fd
commit 6fe9c4d4df
4 changed files with 41 additions and 31 deletions

View File

@@ -1147,7 +1147,8 @@ namespace Umbraco.Core
/// <param name="text">The text to filter.</param>
/// <returns>The safe url segment.</returns>
public static string ToUrlSegment(this string text)
{
{
if (string.IsNullOrWhiteSpace(text)) throw new ArgumentException("message", nameof(text));
return Current.ShortStringHelper.CleanStringForUrlSegment(text);
}
@@ -1158,7 +1159,10 @@ namespace Umbraco.Core
/// <param name="culture">The culture.</param>
/// <returns>The safe url segment.</returns>
public static string ToUrlSegment(this string text, CultureInfo culture)
{
{
if (string.IsNullOrWhiteSpace(text)) throw new ArgumentException("message", nameof(text));
if (culture == null) throw new ArgumentNullException(nameof(culture));
return Current.ShortStringHelper.CleanStringForUrlSegment(text, culture);
}