Skip to content

Commit

Permalink
RedirectToLocalUrl - typo in allowed chars fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasherceg committed Aug 31, 2019
1 parent 8b02c3c commit 276ec14
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class UrlHelperTests
[DataRow(@"\\www.google.com", false)] // Chrome replaces backslashes with forward slashes...
[DataRow(@"\/www.google.com", false)]
[DataRow(@"/\www.google.com", false)]
[DataRow(@"/4aef74ba-388c-4292-9d53-98387e4f797b/reservation?LocationId=e5eed4c5-dfe9-45fd-a341-7408205d76ce&BeginDate=201909011300&Duration=2", true)]
public void UrlHelper_IsLocalUrl(string url, bool exepectedResult)
{
var result = UrlHelper.IsLocalUrl(url);
Expand Down
2 changes: 1 addition & 1 deletion src/DotVVM.Framework/Routing/UrlHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private static bool ContainsOnlyValidUrlChars(string url)
{
if ((url[i] < 'A' || url[i] > 'Z') && (url[i] < 'a' || url[i] > 'z') && (url[i] < '0' || url[i] > '9')
&& url[i] != '-' && url[i] != '.' && url[i] != '_' && url[i] != '~' && url[i] != '%'
&& url[i] != '!' && url[i] != '$' && url[i] != '$' && url[i] != '\'' && url[i] != '(' && url[i] != ')' && url[i] != '*' && url[i] != '+' && url[i] != ',' && url[i] != ';' && url[i] != '='
&& url[i] != '!' && url[i] != '$' && url[i] != '&' && url[i] != '\'' && url[i] != '(' && url[i] != ')' && url[i] != '*' && url[i] != '+' && url[i] != ',' && url[i] != ';' && url[i] != '='
&& url[i] != ':' && url[i] != '@' && url[i] != '/' && url[i] != '?')
{
return false;
Expand Down

0 comments on commit 276ec14

Please sign in to comment.