Fix post title generation

This commit is contained in:
Robert Marshall 2020-01-03 18:58:27 +00:00
parent c40a7fab26
commit 92e479457c
2 changed files with 13 additions and 1 deletions

View file

@ -1,4 +1,5 @@
using System;
using System.Text.RegularExpressions;
using Website.Data.States;
namespace Website.Models
@ -29,7 +30,7 @@ namespace Website.Models
public int UserId { get; private set; }
private void GenerateUrl() {
Url = Title.Replace(' ', '-');
Url = Regex.Replace(Title, @"[^a-zA-Z0-9\.]+", "-").ToLower();
}
public void UpdateTitle(string title) {