Skip to content

Commit

Permalink
fix: 피드백에서 XSS 대응 문자열 원복 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoleee committed Dec 29, 2023
1 parent 8044067 commit 3ed1522
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pages/feedback/[id].page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import useGetFeedbackById from '~/hooks/api/feedbacks/useGetFeedbackById';
import useInternalRouter from '~/hooks/router/useInternalRouter';
import colors from '~/styles/color';
import { BODY_1, HEAD_1, HEAD_2_BOLD, HEAD_2_REGULAR } from '~/styles/typo';
import decodeString from '~/utils/decodeString';

export default function Feedback() {
const router = useInternalRouter();
Expand Down Expand Up @@ -93,7 +94,11 @@ export default function Feedback() {
return (
<div key={question.question_id}>
<div css={questionTitleCss}>Q. {question.title}</div>
<div css={questionBodyCss}>{question.reply}</div>
<div css={questionBodyCss}>
{question.reply.map((item, idx) => {
return decodeString(item) + (question.reply.length !== idx && '\n');
})}
</div>
</div>
);
} else if (question.type === 'choice' && question.form_type !== 'tendency') {
Expand Down Expand Up @@ -128,7 +133,6 @@ const containerCss = css`

const titleCss = css`
${HEAD_1}
display: flex;
align-items: center;
background-color: ${colors.white};
Expand Down Expand Up @@ -173,7 +177,6 @@ const userInfoContainerCss = (theme: Theme) => css`

const userInfoTitleCss = css`
${HEAD_2_REGULAR};
color: ${colors.gray_400};
`;

Expand Down Expand Up @@ -203,23 +206,20 @@ const questionTitleCss = css`

const questionBodyCss = css`
${BODY_1}
margin-top: 10px;
margin-bottom: 40px;
color: ${colors.gray_500};
`;

const questionChoiceBodyCss = css`
${BODY_1}
margin-top: 25px;
margin-bottom: 40px;
color: ${colors.gray_500};
`;

const questionChoiceCss = css`
${HEAD_2_BOLD}
display: flex;
align-items: center;
justify-content: center;
Expand Down

0 comments on commit 3ed1522

Please sign in to comment.