We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 30b1751 commit 20d7730Copy full SHA for 20d7730
apps/space/app/issues/[anchor]/layout.tsx
@@ -13,6 +13,11 @@ export async function generateMetadata({ params }: Props) {
13
const { anchor } = params;
14
const DEFAULT_TITLE = "Plane";
15
const DEFAULT_DESCRIPTION = "Made with Plane, an AI-powered work management platform with publishing capabilities.";
16
+ // Validate anchor before using in request (only allow alphanumeric, -, _)
17
+ const ANCHOR_REGEX = /^[a-zA-Z0-9_-]+$/;
18
+ if (!ANCHOR_REGEX.test(anchor)) {
19
+ return { title: DEFAULT_TITLE, description: DEFAULT_DESCRIPTION };
20
+ }
21
try {
22
const response = await fetch(`${process.env.NEXT_PUBLIC_API_BASE_URL}/api/public/anchor/${anchor}/meta/`);
23
const data = await response.json();
0 commit comments