Temp8 fix typos 2 (#4130)

This commit is contained in:
Chris Houston
2019-01-22 18:03:39 -05:00
committed by Sebastiaan Janssen
parent 01de2eb266
commit 78319bae9e
163 changed files with 343 additions and 344 deletions

View File

@@ -82,7 +82,7 @@ namespace Umbraco.Core
}
/// <summary>
/// Based on the input string, this will detect if the strnig is a JS path or a JS snippet.
/// Based on the input string, this will detect if the string is a JS path or a JS snippet.
/// If a path cannot be determined, then it is assumed to be a snippet the original text is returned
/// with an invalid attempt, otherwise a valid attempt is returned with the resolved path
/// </summary>
@@ -197,7 +197,7 @@ namespace Umbraco.Core
/// <returns></returns>
public static string CleanForXss(this string input, params char[] ignoreFromClean)
{
//remove any html
//remove any HTML
input = input.StripHtml();
//strip out any potential chars involved with XSS
return input.ExceptChars(new HashSet<char>(CleanForXssChars.Except(ignoreFromClean)));
@@ -314,7 +314,7 @@ namespace Umbraco.Core
return decryptedValue.ToString();
}
//this is from SqlMetal and just makes it a bit of fun to allow pluralisation
//this is from SqlMetal and just makes it a bit of fun to allow pluralization
public static string MakePluralName(this string name)
{
if ((name.EndsWith("x", StringComparison.OrdinalIgnoreCase) || name.EndsWith("ch", StringComparison.OrdinalIgnoreCase)) || (name.EndsWith("s", StringComparison.OrdinalIgnoreCase) || name.EndsWith("sh", StringComparison.OrdinalIgnoreCase)))
@@ -532,10 +532,10 @@ namespace Umbraco.Core
}
/// <summary>
/// Strips all html from a string.
/// Strips all HTML from a string.
/// </summary>
/// <param name="text">The text.</param>
/// <returns>Returns the string without any html tags.</returns>
/// <returns>Returns the string without any HTML tags.</returns>
public static string StripHtml(this string text)
{
const string pattern = @"<(.|\n)*?>";
@@ -723,7 +723,7 @@ namespace Umbraco.Core
/// <summary>
/// Generates a hash of a string based on the FIPS compliance setting.
/// </summary>
/// <param name="str">Referrs to itself</param>
/// <param name="str">Refers to itself</param>
/// <returns>The hashed string</returns>
public static string GenerateHash(this string str)
{
@@ -735,7 +735,7 @@ namespace Umbraco.Core
/// <summary>
/// Converts the string to MD5
/// </summary>
/// <param name="stringToConvert">Referrs to itself</param>
/// <param name="stringToConvert">Refers to itself</param>
/// <returns>The MD5 hashed string</returns>
public static string ToMd5(this string stringToConvert)
{
@@ -745,7 +745,7 @@ namespace Umbraco.Core
/// <summary>
/// Converts the string to SHA1
/// </summary>
/// <param name="stringToConvert">referrs to itself</param>
/// <param name="stringToConvert">refers to itself</param>
/// <returns>The SHA1 hashed string</returns>
public static string ToSHA1(this string stringToConvert)
{
@@ -754,7 +754,7 @@ namespace Umbraco.Core
/// <summary>Generate a hash of a string based on the hashType passed in
/// </summary>
/// <param name="str">Referrs to itself</param>
/// <param name="str">Refers to itself</param>
/// <param name="hashType">String with the hash type. See remarks section of the CryptoConfig Class in MSDN docs for a list of possible values.</param>
/// <returns>The hashed string</returns>
private static string GenerateHash(this string str, string hashType)
@@ -773,7 +773,7 @@ namespace Umbraco.Core
//create a StringBuilder object
var stringBuilder = new StringBuilder();
//loop to each each byte
//loop to each byte
foreach (var b in hashedByteArray)
{
//append it to our StringBuilder
@@ -1034,7 +1034,7 @@ namespace Umbraco.Core
}
/// <summary>
/// Returns a new string in which all occurences of specified strings are replaced by other specified strings.
/// Returns a new string in which all occurrences of specified strings are replaced by other specified strings.
/// </summary>
/// <param name="text">The string to filter.</param>
/// <param name="replacements">The replacements definition.</param>
@@ -1052,7 +1052,7 @@ namespace Umbraco.Core
}
/// <summary>
/// Returns a new string in which all occurences of specified characters are replaced by a specified character.
/// Returns a new string in which all occurrences of specified characters are replaced by a specified character.
/// </summary>
/// <param name="text">The string to filter.</param>
/// <param name="chars">The characters to replace.</param>
@@ -1219,7 +1219,7 @@ namespace Umbraco.Core
/// Splits a Pascal cased string into a phrase separated by spaces.
/// </summary>
/// <param name="phrase">The text to split.</param>
/// <returns>The splitted text.</returns>
/// <returns>The split text.</returns>
public static string SplitPascalCasing(this string phrase)
{
return Current.ShortStringHelper.SplitPascalCasing(phrase, ' ');
@@ -1270,7 +1270,7 @@ namespace Umbraco.Core
/// <returns>Updated string</returns>
public static string Replace(this string source, string oldString, string newString, StringComparison stringComparison)
{
// This initialisation ensures the first check starts at index zero of the source. On successive checks for
// This initialization ensures the first check starts at index zero of the source. On successive checks for
// a match, the source is skipped to immediately after the last replaced occurrence for efficiency
// and to avoid infinite loops when oldString and newString compare equal.
int index = -1 * newString.Length;
@@ -1281,7 +1281,7 @@ namespace Umbraco.Core
// Remove the old text.
source = source.Remove(index, oldString.Length);
// Add the replacemenet text.
// Add the replacement text.
source = source.Insert(index, newString);
}
@@ -1357,7 +1357,7 @@ namespace Umbraco.Core
/// </summary>
/// <param name="haystack">The string to check</param>
/// <param name="needles">The collection of strings to check are contained within the first string</param>
/// <param name="comparison">The type of comparision to perform - defaults to <see cref="StringComparison.CurrentCulture"/></param>
/// <param name="comparison">The type of comparison to perform - defaults to <see cref="StringComparison.CurrentCulture"/></param>
/// <returns>True if any of the needles are contained with haystack; otherwise returns false</returns>
/// Added fix to ensure the comparison is used - see http://issues.umbraco.org/issue/U4-11313
public static bool ContainsAny(this string haystack, IEnumerable<string> needles, StringComparison comparison = StringComparison.CurrentCulture)