diff --git a/OliverBooth/Pages/Blog/Index.cshtml.cs b/OliverBooth/Pages/Blog/Index.cshtml.cs index f825701..87f8497 100644 --- a/OliverBooth/Pages/Blog/Index.cshtml.cs +++ b/OliverBooth/Pages/Blog/Index.cshtml.cs @@ -1,3 +1,4 @@ +using System.Web; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using OliverBooth.Common.Data.Blog; @@ -23,7 +24,7 @@ public class Index : PageModel { if (postId.HasValue == wpPostId.HasValue) { - Tag = tag?.Split('+').Select(t => t.Replace("%20", " ")).ToArray() ?? []; + Tag = (tag?.Split('+').Select(HttpUtility.UrlDecode).ToArray() ?? [])!; return Page(); } diff --git a/OliverBooth/Pages/Blog/List.cshtml.cs b/OliverBooth/Pages/Blog/List.cshtml.cs index 4660b20..51b3a2a 100644 --- a/OliverBooth/Pages/Blog/List.cshtml.cs +++ b/OliverBooth/Pages/Blog/List.cshtml.cs @@ -1,3 +1,4 @@ +using System.Web; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; @@ -30,7 +31,7 @@ public class List : PageModel } PageNumber = page; - Tag = tag?.Split('+').Select(t => t.Replace("%20", " ")).ToArray() ?? []; + Tag = (tag?.Split('+').Select(HttpUtility.UrlDecode).ToArray() ?? [])!; return Page(); } }