Skip to content

Commit

Permalink
fix(urlize): do not permit "/"
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobritodev committed Nov 16, 2021
1 parent 4c85d0d commit 2592e73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/NetDevPack/Utilities/StringExtensions.cs
Expand Up @@ -13,7 +13,7 @@ public static class StringExtensions
{
private static char sensitive = '*';
private static char at = '@';
private static readonly Regex UrlizeRegex = new Regex(@"[^A-Za-z0-9_\/~]+", RegexOptions.Multiline | RegexOptions.Compiled);
private static readonly Regex UrlizeRegex = new Regex(@"[^A-Za-z0-9_~]+", RegexOptions.Multiline | RegexOptions.Compiled);
private static readonly Regex EmailRegex = new Regex(@"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", RegexOptions.Compiled);

public static string UrlEncode(this string url)
Expand Down
1 change: 1 addition & 0 deletions tests/NetDevPack.Tests/Utilities/StringTest.cs
Expand Up @@ -24,6 +24,7 @@ public void Should_Truncate_Sensitive_Information(string data, string expected)
[InlineData(".net core 5.0 - pacotes", "net-core-5-0-pacotes")]
[InlineData("Versão do AspNetCore do curso", "versao-do-aspnetcore-do-curso")]
[InlineData(" Tipo de dado gerado pela configuração HasCloumnType<string> ", "tipo-de-dado-gerado-pela-configuracao-hascloumntype-string")]
[InlineData("esse ou/esse?", "esse-ou-esse")]
public void Should_Urlize(string content, string expected)
{
content.Urlize().Should().Be(expected);
Expand Down

0 comments on commit 2592e73

Please sign in to comment.