Skip to content

Commit 03f647c

Browse files
check for paths that are empty, whitespace, or "new-page"
1 parent 5d0ef7d commit 03f647c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

website/src/pages/edit.page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ const NewPage = () => {
105105
const validatePath = (path: string): string | null => {
106106
const formatted = formatPath(path)
107107
const pathSegments = formatted.split("/").filter(Boolean) // Remove empty strings
108-
108+
if (path.trim().length == 0 || path == "/new-page") {
109+
return `Please provide a meaningful path.`
110+
}
109111
// Check if any segment contains a disallowed word
110112
for (const segment of pathSegments) {
111113
for (const disallowed of DISALLOWED_WORDS) {

0 commit comments

Comments
 (0)