From c7eaf9a5911f947b2af1513fc5e07e67ca5521ba Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 22 Dec 2015 16:07:45 +0100 Subject: [PATCH] U4-7600 Remove obsoleted string helpers & string extensions --- .../Factories/UmbracoEntityFactory.cs | 3 +- .../Services/ContentTypeService.cs | 2 +- src/Umbraco.Core/StringExtensions.cs | 116 ++---------------- .../StronglyTypedModels/TypedModelBase.cs | 2 +- .../Strings/CmsHelperCasingTests.cs | 2 +- .../Strings/DefaultShortStringHelperTests.cs | 15 --- .../Strings/LegacyStringExtensionsTests.cs | 32 ++--- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 1 - .../umbraco.presentation/content.cs | 2 +- .../umbraco/controls/Tree/JTreeContextMenu.cs | 3 +- src/umbraco.cms/businesslogic/ContentType.cs | 4 +- .../businesslogic/member/MemberType.cs | 2 +- .../propertytype/propertytype.cs | 2 +- .../businesslogic/web/DocumentType.cs | 52 -------- src/umbraco.cms/helpers/Casing.cs | 51 -------- src/umbraco.cms/umbraco.cms.csproj | 1 - 16 files changed, 39 insertions(+), 251 deletions(-) delete mode 100644 src/umbraco.cms/helpers/Casing.cs diff --git a/src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs b/src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs index 660cc95029..658ddad2d4 100644 --- a/src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs @@ -6,6 +6,7 @@ using System.Reflection; using Umbraco.Core.Models; using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Persistence.Repositories; +using Umbraco.Core.Strings; namespace Umbraco.Core.Persistence.Factories { @@ -17,7 +18,7 @@ namespace Umbraco.Core.Persistence.Factories //figure out what extra properties we have that are not on the IUmbracoEntity and add them to additional data foreach (var k in originalEntityProperties.Keys - .Select(x => new { orig = x, title = x.ConvertCase(StringAliasCaseType.PascalCase) }) + .Select(x => new { orig = x, title = x.ToCleanString(CleanStringType.PascalCase) }) .Where(x => entityProps.InvariantContains(x.title) == false)) { entity.AdditionalData[k.title] = originalEntityProperties[k.orig]; diff --git a/src/Umbraco.Core/Services/ContentTypeService.cs b/src/Umbraco.Core/Services/ContentTypeService.cs index 97fbfbff2e..59a13b6aea 100644 --- a/src/Umbraco.Core/Services/ContentTypeService.cs +++ b/src/Umbraco.Core/Services/ContentTypeService.cs @@ -1050,7 +1050,7 @@ namespace Umbraco.Core.Services var contentTypes = GetAllContentTypes(); foreach (ContentType contentType in contentTypes) { - string safeAlias = contentType.Alias.ToUmbracoAlias(); + string safeAlias = contentType.Alias.ToSafeAlias(); if (safeAlias != null) { strictSchemaBuilder.AppendLine(String.Format("", safeAlias)); diff --git a/src/Umbraco.Core/StringExtensions.cs b/src/Umbraco.Core/StringExtensions.cs index b6d6d7ce27..6397b22fe0 100644 --- a/src/Umbraco.Core/StringExtensions.cs +++ b/src/Umbraco.Core/StringExtensions.cs @@ -25,10 +25,6 @@ namespace Umbraco.Core /// public static class StringExtensions { - [UmbracoWillObsolete("Do not use this constants. See IShortStringHelper.CleanStringForSafeAliasJavaScriptCode.")] - public const string UmbracoValidAliasCharacters = "_-abcdefghijklmnopqrstuvwxyz1234567890"; - [UmbracoWillObsolete("Do not use this constants. See IShortStringHelper.CleanStringForSafeAliasJavaScriptCode.")] - public const string UmbracoInvalidFirstCharacters = "01234567890"; private static readonly char[] ToCSharpHexDigitLower = "0123456789abcdef".ToCharArray(); private static readonly char[] ToCSharpEscapeChars; @@ -1027,62 +1023,7 @@ namespace Umbraco.Core } // FORMAT STRINGS - - // note: LegacyShortStringHelper will produce a 100% backward-compatible output for ToUrlAlias. - // this is the only reason why we keep the method, otherwise it should be removed, and with any other - // helper we fallback to ToUrlSegment anyway. - - /// - /// Converts string to a URL alias. - /// - /// The value. - /// The char replacements. - /// if set to true replace double dashes. - /// if set to true strip non ASCII. - /// if set to true URL encode. - /// - /// - /// This ensures that ONLY ascii chars are allowed and of those ascii chars, only digits and lowercase chars, all - /// punctuation, etc... are stripped out, however this method allows you to pass in string's to replace with the - /// specified replacement character before the string is converted to ascii and it has invalid characters stripped out. - /// This allows you to replace strings like & , etc.. with your replacement character before the automatic - /// reduction. - /// - [Obsolete("This method should be removed. Use ToUrlSegment instead.")] - public static string ToUrlAlias(this string value, IDictionary charReplacements, bool replaceDoubleDashes, bool stripNonAscii, bool urlEncode) - { - var helper = ShortStringHelper; - var legacy = helper as LegacyShortStringHelper; - return legacy != null - ? legacy.LegacyToUrlAlias(value, charReplacements, replaceDoubleDashes, stripNonAscii, urlEncode) - : helper.CleanStringForUrlSegment(value); - } - - // note: LegacyShortStringHelper will produce a 100% backward-compatible output for FormatUrl. - // this is the only reason why we keep the method, otherwise it should be removed, and with any other - // helper we fallback to ToUrlSegment anyway. - - /// - /// Cleans a string to produce a string that can safely be used in an url segment. - /// - /// The text to filter. - /// The safe url segment. - /// - /// When using the legacy ShortStringHelper, uses UmbracoSettings.UrlReplaceCharacters - /// and UmbracoSettings.RemoveDoubleDashesFromUrlReplacing. - /// Other helpers may use different parameters. - /// - [Obsolete("This method should be removed. Use ToUrlSegment instead.")] - public static string FormatUrl(this string url) - { - var helper = ShortStringHelper; - var legacy = helper as LegacyShortStringHelper; - return legacy != null ? legacy.LegacyFormatUrl(url) : helper.CleanStringForUrlSegment(url); - } - - // note: LegacyShortStringHelper will produce a 100% backward-compatible output for ToSafeAlias - // other helpers may not. DefaultShortStringHelper produces better, but non-compatible, results. - + /// /// Cleans a string to produce a string that can safely be used in an alias. /// @@ -1140,26 +1081,6 @@ namespace Umbraco.Core return UmbracoConfig.For.UmbracoSettings().Content.ForceSafeAliases ? alias.ToSafeAlias(culture) : alias; } - // note: LegacyShortStringHelper will produce a 100% backward-compatible output for ToUmbracoAlias. - // this is the only reason why we keep the method, otherwise it should be removed, and with any other - // helper we fallback to ToSafeAlias anyway. - - /// - /// Cleans a string to produce a string that can safely be used in an alias. - /// - /// The text to filter. - /// The case type. THIS PARAMETER IS IGNORED. - /// Indicates whether spaces should be removed. THIS PARAMETER IS IGNORED. - /// The safe alias. - /// CamelCase, and remove spaces, whatever the parameters. - [Obsolete("This method should be removed. Use ToSafeAlias instead.")] - public static string ToUmbracoAlias(this string phrase, StringAliasCaseType caseType = StringAliasCaseType.CamelCase, bool removeSpaces = false) - { - var helper = ShortStringHelper; - var legacy = helper as LegacyShortStringHelper; - return legacy != null ? legacy.LegacyCleanStringForUmbracoAlias(phrase) : helper.CleanStringForSafeAlias(phrase); - } - // the new methods to get a url segment /// @@ -1183,31 +1104,6 @@ namespace Umbraco.Core return ShortStringHelper.CleanStringForUrlSegment(text, culture); } - // note: LegacyShortStringHelper will produce 100% backward-compatible output for ConvertCase. - // this is the only reason why we keep the method, otherwise it should be removed, and with any other - // helper we fallback to CleanString(ascii, alias) anyway. - - /// - /// Filters a string to convert case, and more. - /// - /// the text to filter. - /// The string case type. - /// The filtered text. - /// - /// This is the legacy method, so we can't really change it, although it has issues (see unit tests). - /// It does more than "converting the case", and also remove spaces, etc. - /// - [Obsolete("This method should be removed. Use ToCleanString instead.")] - public static string ConvertCase(this string phrase, StringAliasCaseType cases) - { - var helper = ShortStringHelper; - var legacy = helper as LegacyShortStringHelper; - var cases2 = cases.ToCleanStringType() & CleanStringType.CaseMask; - return legacy != null - ? legacy.LegacyConvertStringCase(phrase, cases2) - : helper.CleanString(phrase, CleanStringType.Ascii | CleanStringType.ConvertCase | cases2); - } - // the new methods to clean a string (to alias, url segment...) /// @@ -1277,6 +1173,16 @@ namespace Umbraco.Core return ShortStringHelper.SplitPascalCasing(phrase, ' '); } + //NOTE: Not sure what this actually does but is used a few places, need to figure it out and then move to StringExtensions and obsolete. + // it basically is yet another version of SplitPascalCasing + // plugging string extensions here to be 99% compatible + // the only diff. is with numbers, Number6Is was "Number6 Is", and the new string helper does it too, + // but the legacy one does "Number6Is"... assuming it is not a big deal. + internal static string SpaceCamelCasing(this string phrase) + { + return phrase.Length < 2 ? phrase : phrase.SplitPascalCasing().ToFirstUpperInvariant(); + } + /// /// Cleans a string, in the context of the invariant culture, to produce a string that can safely be used as a filename, /// both internally (on disk) and externally (as a url). diff --git a/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/TypedModelBase.cs b/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/TypedModelBase.cs index 0de99c76ad..862c8f48cb 100644 --- a/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/TypedModelBase.cs +++ b/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/TypedModelBase.cs @@ -155,7 +155,7 @@ namespace Umbraco.Tests.PublishedContent.StronglyTypedModels public static string ToUmbracoAlias(this MethodBase methodBase) { - return methodBase.CleanCallingMethodName().ToUmbracoAlias(); + return methodBase.CleanCallingMethodName().ToSafeAlias(); } public static string ToSingular(this string pluralWord) diff --git a/src/Umbraco.Tests/Strings/CmsHelperCasingTests.cs b/src/Umbraco.Tests/Strings/CmsHelperCasingTests.cs index 0f7b4fbd41..77682661b2 100644 --- a/src/Umbraco.Tests/Strings/CmsHelperCasingTests.cs +++ b/src/Umbraco.Tests/Strings/CmsHelperCasingTests.cs @@ -26,7 +26,7 @@ namespace Umbraco.Tests.Strings [TestCase("WhoIsNumber6InTheVillage", "Who Is Number6 In The Village")] // now fixed since DefaultShortStringHelper is the default public void SpaceCamelCasing(string input, string expected) { - var output = umbraco.cms.helpers.Casing.SpaceCamelCasing(input); + var output = input.SpaceCamelCasing(); Assert.AreEqual(expected, output); } diff --git a/src/Umbraco.Tests/Strings/DefaultShortStringHelperTests.cs b/src/Umbraco.Tests/Strings/DefaultShortStringHelperTests.cs index 0b7552194d..68e28d7cff 100644 --- a/src/Umbraco.Tests/Strings/DefaultShortStringHelperTests.cs +++ b/src/Umbraco.Tests/Strings/DefaultShortStringHelperTests.cs @@ -103,21 +103,6 @@ namespace Umbraco.Tests.Strings return s; } - [Test] - public void U4_4055_4056() - { - var settings = SettingsForTests.GenerateMockSettings(); - var contentMock = Mock.Get(settings.RequestHandler); - contentMock.Setup(x => x.CharCollection).Returns(Enumerable.Empty()); - contentMock.Setup(x => x.ConvertUrlsToAscii).Returns(false); - SettingsForTests.ConfigureSettings(settings); - - const string input = "publishedVersion"; - - Assert.AreEqual("PublishedVersion", input.ConvertCase(StringAliasCaseType.PascalCase)); // obsolete, use the one below - Assert.AreEqual("PublishedVersion", input.ToCleanString(CleanStringType.ConvertCase | CleanStringType.PascalCase | CleanStringType.Ascii)); // role, case and code - } - [Test] public void U4_4056() { diff --git a/src/Umbraco.Tests/Strings/LegacyStringExtensionsTests.cs b/src/Umbraco.Tests/Strings/LegacyStringExtensionsTests.cs index a7ed593a4d..aaafc61794 100644 --- a/src/Umbraco.Tests/Strings/LegacyStringExtensionsTests.cs +++ b/src/Umbraco.Tests/Strings/LegacyStringExtensionsTests.cs @@ -105,14 +105,14 @@ namespace Umbraco.Tests.Strings var name5 = "'em guys-over there, are#goin' a \"little\"bit crazy eh!! :)"; var name6 = "汉#字*/漢?字"; - var url1 = name1.ToUrlAlias(replacements, true, true, false); - var url2 = name2.ToUrlAlias(replacements, true, true, false); - var url3 = name3.ToUrlAlias(replacements, true, true, false); - var url4 = name4.ToUrlAlias(replacements, true, true, false); - var url5 = name5.ToUrlAlias(replacements, true, true, false); - var url6 = name6.ToUrlAlias(replacements, true, true, false); - var url7 = name6.ToUrlAlias(replacements, true, false, false); - var url8 = name6.ToUrlAlias(replacements, true, false, true); + var url1 = name1.ToUrlSegment(); + var url2 = name2.ToUrlSegment(); + var url3 = name3.ToUrlSegment(); + var url4 = name4.ToUrlSegment(); + var url5 = name5.ToUrlSegment(); + var url6 = name6.ToUrlSegment(); + var url7 = name6.ToUrlSegment(); + var url8 = name6.ToUrlSegment(); Assert.AreEqual("home-page", url1); Assert.AreEqual("shannons-home-page", url2); @@ -136,9 +136,9 @@ namespace Umbraco.Tests.Strings //Act - var camelCase1 = name1.ConvertCase(StringAliasCaseType.CamelCase); - var camelCase2 = name2.ConvertCase(StringAliasCaseType.CamelCase); - var camelCase3 = name3.ConvertCase(StringAliasCaseType.CamelCase); + var camelCase1 = name1.ToCleanString(CleanStringType.CamelCase); + var camelCase2 = name2.ToCleanString(CleanStringType.CamelCase); + var camelCase3 = name3.ToCleanString(CleanStringType.CamelCase); //Assert @@ -160,11 +160,11 @@ namespace Umbraco.Tests.Strings //Act - var alias1 = name1.ToUmbracoAlias(); - var alias2 = name2.ToUmbracoAlias(); - var alias3 = name3.ToUmbracoAlias(); - var alias4 = name4.ToUmbracoAlias(); - var alias5 = name5.ToUmbracoAlias(/*StringAliasCaseType.PascalCase*/); + var alias1 = name1.ToSafeAlias(); + var alias2 = name2.ToSafeAlias(); + var alias3 = name3.ToSafeAlias(); + var alias4 = name4.ToSafeAlias(); + var alias5 = name5.ToSafeAlias(/*StringAliasCaseType.PascalCase*/); //Assert diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index a2fca708c9..5590913671 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -689,7 +689,6 @@ - diff --git a/src/Umbraco.Web/umbraco.presentation/content.cs b/src/Umbraco.Web/umbraco.presentation/content.cs index 3a60cb0534..3407482b91 100644 --- a/src/Umbraco.Web/umbraco.presentation/content.cs +++ b/src/Umbraco.Web/umbraco.presentation/content.cs @@ -470,7 +470,7 @@ namespace umbraco { // Lets cache the DTD to save on the DB hit on the subsequent use - string dtd = DocumentType.GenerateDtd(); + string dtd = ApplicationContext.Current.Services.ContentTypeService.GetDtd(); // Prepare an XmlDocument with an appropriate inline DTD to match // the expected content diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenu.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenu.cs index 4d8740f32f..831d4f58de 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenu.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenu.cs @@ -14,6 +14,7 @@ using umbraco.cms.presentation.Trees; using umbraco.BasePages; using System.Web.Services; using umbraco.BusinessLogic; +using Umbraco.Core; namespace umbraco.controls.Tree { @@ -42,7 +43,7 @@ namespace umbraco.controls.Tree { // Make new Iaction PlaceboAction pa = new PlaceboAction(a); - pa.JsFunctionName = "IActionProxy_" + umbraco.cms.helpers.Casing.SafeAlias(pa.Alias) + "()"; + pa.JsFunctionName = "IActionProxy_" + pa.Alias.ToSafeAlias() + "()"; allActions.Add(pa); } diff --git a/src/umbraco.cms/businesslogic/ContentType.cs b/src/umbraco.cms/businesslogic/ContentType.cs index 75ebe4c8d3..1a1fb05590 100644 --- a/src/umbraco.cms/businesslogic/ContentType.cs +++ b/src/umbraco.cms/businesslogic/ContentType.cs @@ -188,7 +188,7 @@ namespace umbraco.cms.businesslogic SqlHelper.ExecuteNonQuery( "Insert into cmsContentType (nodeId,alias,icon) values (" + nodeId + ",'" + - (formatAlias ? helpers.Casing.SafeAliasWithForcingCheck(alias) : alias) + + (formatAlias ? alias.ToSafeAliasWithForcingCheck() : alias) + "','" + iconUrl + "')"); } @@ -299,7 +299,7 @@ namespace umbraco.cms.businesslogic get { return _alias; } set { - _alias = helpers.Casing.SafeAliasWithForcingCheck(value); + _alias = value.ToSafeAliasWithForcingCheck(); // validate if alias is empty if (String.IsNullOrEmpty(_alias)) diff --git a/src/umbraco.cms/businesslogic/member/MemberType.cs b/src/umbraco.cms/businesslogic/member/MemberType.cs index f310741699..b3ce6b1b69 100644 --- a/src/umbraco.cms/businesslogic/member/MemberType.cs +++ b/src/umbraco.cms/businesslogic/member/MemberType.cs @@ -156,7 +156,7 @@ namespace umbraco.cms.businesslogic.member /// Creator of the MemberType public static MemberType MakeNew(User u, string Text) { - var alias = helpers.Casing.SafeAliasWithForcingCheck(Text); + var alias = Text.ToSafeAliasWithForcingCheck(); //special case, if it stars with an underscore, we have to re-add it for member types if (Text.StartsWith("_")) alias = "_" + alias; var mt = new Umbraco.Core.Models.MemberType(-1) diff --git a/src/umbraco.cms/businesslogic/propertytype/propertytype.cs b/src/umbraco.cms/businesslogic/propertytype/propertytype.cs index 01af841074..86b67dd479 100644 --- a/src/umbraco.cms/businesslogic/propertytype/propertytype.cs +++ b/src/umbraco.cms/businesslogic/propertytype/propertytype.cs @@ -204,7 +204,7 @@ namespace umbraco.cms.businesslogic.propertytype _alias = value; InvalidateCache(); SqlHelper.ExecuteNonQuery("Update cmsPropertyType set alias = @alias where id= @id", - SqlHelper.CreateParameter("@alias", Casing.SafeAliasWithForcingCheck(_alias)), + SqlHelper.CreateParameter("@alias", _alias.ToSafeAliasWithForcingCheck()), SqlHelper.CreateParameter("@id", Id)); } } diff --git a/src/umbraco.cms/businesslogic/web/DocumentType.cs b/src/umbraco.cms/businesslogic/web/DocumentType.cs index 51e757f138..3f7dc79912 100644 --- a/src/umbraco.cms/businesslogic/web/DocumentType.cs +++ b/src/umbraco.cms/businesslogic/web/DocumentType.cs @@ -68,58 +68,6 @@ namespace umbraco.cms.businesslogic.web #region Static Methods - /// - /// Generates the complete (simplified) XML DTD - /// - /// The DTD as a string - [Obsolete("Obsolete, Use Umbraco.Core.Services.ContentTypeService.GetDtd()", false)] - public static string GenerateDtd() - { - StringBuilder dtd = new StringBuilder(); - // Renamed 'umbraco' to 'root' since the top level of the DOCTYPE should specify the name of the root node for it to be valid; - // there's no mention of 'umbraco' anywhere in the schema that this DOCTYPE governs - // (Alex N 20100212) - dtd.AppendLine(""); - - return dtd.ToString(); - } - - [Obsolete("Obsolete, Use Umbraco.Core.Services.ContentTypeService.GetContentTypesDtd()", false)] - public static string GenerateXmlDocumentType() - { - StringBuilder dtd = new StringBuilder(); - // TEMPORARY: Added Try-Catch to this call since trying to generate a DTD against a corrupt db - // or a broken connection string is not handled yet - // (Alex N 20100212) - try - { - StringBuilder strictSchemaBuilder = new StringBuilder(); - - List dts = GetAllAsList(); - foreach (DocumentType dt in dts) - { - string safeAlias = helpers.Casing.SafeAlias(dt.Alias); - if (safeAlias != null) - { - strictSchemaBuilder.AppendLine(String.Format("", safeAlias)); - strictSchemaBuilder.AppendLine(String.Format("", safeAlias)); - } - } - - // Only commit the strong schema to the container if we didn't generate an error building it - dtd.Append(strictSchemaBuilder); - } - catch (Exception exception) - { - LogHelper.Error("Exception while trying to build DTD for Xml schema; is Umbraco installed correctly and the connection string configured?", exception); - } - return dtd.ToString(); - - } - [Obsolete("Obsolete, Use Umbraco.Core.Services.ContentTypeService.GetContentType()", false)] public new static DocumentType GetByAlias(string Alias) { diff --git a/src/umbraco.cms/helpers/Casing.cs b/src/umbraco.cms/helpers/Casing.cs deleted file mode 100644 index 1cf6eaf698..0000000000 --- a/src/umbraco.cms/helpers/Casing.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Linq; -using System.Text; -using Umbraco.Core; -using Umbraco.Core.CodeAnnotations; - -namespace umbraco.cms.helpers -{ - //TODO: Most of this logic now exists in the Umbraco.Core string extensions, whatever logic exists here that is not there - // should be moved there and this should be obsoleted. - - public class Casing - { - [Obsolete("Use Umbraco.Core.StringExtensions.UmbracoValidAliasCharacters instead")] - public const string VALID_ALIAS_CHARACTERS = "_-abcdefghijklmnopqrstuvwxyz1234567890"; - - [Obsolete("Use Umbraco.Core.StringExtensions.UmbracoInvalidFirstCharacters instead")] - public const string INVALID_FIRST_CHARACTERS = "0123456789"; - - /// - /// A helper method to ensure that an Alias string doesn't contains any illegal characters - /// which is defined in a private constant 'ValidCharacters' in this class. - /// Conventions over configuration, baby. You can't touch this - MC Hammer! - /// - /// The alias. - /// An alias guaranteed not to contain illegal characters - [Obsolete("Use Umbraco.Core.StringExtensions.ToSafeAlias instead")] - public static string SafeAlias(string alias) - { - return alias.ToSafeAlias(); // and anyway the code is the same - } - - [Obsolete("Use Umbraco.Core.StringExtensions.ToSafeAliasWithForcingCheck instead")] - public static string SafeAliasWithForcingCheck(string alias) - { - return alias.ToSafeAliasWithForcingCheck(); // and anyway the code is the same - } - - //NOTE: Not sure what this actually does but is used a few places, need to figure it out and then move to StringExtensions and obsolete. - // it basically is yet another version of SplitPascalCasing - // plugging string extensions here to be 99% compatible - // the only diff. is with numbers, Number6Is was "Number6 Is", and the new string helper does it too, - // but the legacy one does "Number6Is"... assuming it is not a big deal. - - [UmbracoWillObsolete("We should really obsolete that one too.")] - public static string SpaceCamelCasing(string text) - { - return text.Length < 2 ? text : text.SplitPascalCasing().ToFirstUpperInvariant(); - } - } -} diff --git a/src/umbraco.cms/umbraco.cms.csproj b/src/umbraco.cms/umbraco.cms.csproj index 7b7d439048..692d3e3d9b 100644 --- a/src/umbraco.cms/umbraco.cms.csproj +++ b/src/umbraco.cms/umbraco.cms.csproj @@ -246,7 +246,6 @@ -