Skip to content

Commit

Permalink
fix: escape regex in ProjectDeleteModal (#8998)
Browse files Browse the repository at this point in the history
(cherry picked from commit f73fd09)
  • Loading branch information
keita-determined authored and determined-ci committed Mar 14, 2024
1 parent de8d02d commit 05a75b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webui/react/src/components/ProjectDeleteModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Form from 'hew/Form';
import Input from 'hew/Input';
import { Modal } from 'hew/Modal';
import { escapeRegExp } from 'lodash';
import React, { useCallback, useId } from 'react';

import { deleteProject } from 'services/api';
Expand Down Expand Up @@ -68,7 +69,7 @@ const ProjectDeleteModalComponent: React.FC<Props> = ({ onClose, project, onDele
rules={[
{
message: 'Please type the project name to confirm',
pattern: new RegExp(`^${project.name}$`),
pattern: new RegExp(`^${escapeRegExp(project.name)}$`),
required: true,
},
]}>
Expand Down

0 comments on commit 05a75b3

Please sign in to comment.