Skip to content

Commit

Permalink
Don't allow periods in zone or camera group names (#13400)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkeye217 authored Aug 28, 2024
1 parent ca0f6e4 commit f4f3cfa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions web/src/components/filter/CameraGroupSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,14 @@ export function CameraGroupEdit({
message: "Camera group name already exists.",
},
)
.refine(
(value: string) => {
return !value.includes(".");
},
{
message: "Camera group name must not contain a period.",
},
)
.refine((value: string) => value.toLowerCase() !== "default", {
message: "Invalid camera group name.",
}),
Expand Down
8 changes: 8 additions & 0 deletions web/src/components/settings/ZoneEditPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ export default function ZoneEditPane({
{
message: "Zone name already exists on this camera.",
},
)
.refine(
(value: string) => {
return !value.includes(".");
},
{
message: "Zone name must not contain a period.",
},
),
inertia: z.coerce
.number()
Expand Down

0 comments on commit f4f3cfa

Please sign in to comment.