From 1e2c0d1ee132a483e32855904d6c620f8bfd2158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=B6=9B?= Date: Thu, 25 Apr 2019 11:19:19 +0800 Subject: [PATCH] UrlEncode blog short name within Redirect method --- .../src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml.cs index 976f78b7d1..fe0a809d07 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml.cs @@ -54,7 +54,7 @@ namespace Volo.Blogging.Pages.Blog.Posts var postWithDetailsDto = await _postAppService.CreateAsync(ObjectMapper.Map(Post)); //TODO: Try Url.Page(...) - return Redirect(Url.Content($"~/blog/{blog.ShortName}/{WebUtility.UrlEncode(postWithDetailsDto.Url)}")); + return Redirect(Url.Content($"~/blog/{WebUtility.UrlEncode(blog.ShortName)}/{WebUtility.UrlEncode(postWithDetailsDto.Url)}")); } public class CreatePostViewModel