feat: Light mode default, auth, Posts rename, display scaling, TinyMCE improvements
This commit is contained in:
1 parent
51d086dab9
commit
39fcd9ec6e
154 files changed
+12897
-133
No files matched your search
@@ -1,14 +1,10 @@
|
||||
using NoticeBoard.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace NoticeBoard.Routing;
|
||||
|
||||
public class DeviceSlugConstraint : IRouteConstraint
|
||||
{
|
||||
// Reserved paths that should NOT be treated as device slugs
|
||||
private static readonly HashSet<string> ReservedPaths = new(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"admin", "api", "d", "error", "css", "js", "lib", "uploads", "favicon.ico"
|
||||
"admin", "api", "account", "d", "error", "css", "js", "lib", "uploads", "favicon.ico"
|
||||
};
|
||||
|
||||
public bool Match(HttpContext? httpContext, IRouter? route, string routeKey,
|
||||
@@ -16,11 +12,8 @@ public class DeviceSlugConstraint : IRouteConstraint
|
||||
{
|
||||
if (values.TryGetValue(routeKey, out var value) && value is string slug)
|
||||
{
|
||||
// Block reserved paths
|
||||
if (ReservedPaths.Contains(slug))
|
||||
return false;
|
||||
|
||||
// Only match lowercase alphanumeric + hyphens
|
||||
return slug.All(c => char.IsLetterOrDigit(c) || c == '-');
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user