fix: xss link
This commit is contained in:
@@ -32,7 +32,7 @@ const Index: FC<Props> = ({ data }) => {
|
||||
<Alert className="mb-4" variant={data.level}>
|
||||
{data.level === 'info' ? (
|
||||
<div>
|
||||
{data.msg.indexOf('http') > -1 ? (
|
||||
{data.msg.startsWith('http') ? (
|
||||
<p>
|
||||
{data.description}{' '}
|
||||
<a href={data.msg} className="alert-exist">
|
||||
|
||||
@@ -158,13 +158,15 @@ const Index: FC<IProps> = ({ refreshCount }) => {
|
||||
reason?.content_type &&
|
||||
(reason?.reason_type !== 60 ? (
|
||||
<span> {flagItemData?.reason_content}</span>
|
||||
) : (
|
||||
) : flagItemData.reason_content?.startsWith('http') ? (
|
||||
<a href={flagItemData.reason_content} className="alert-exist">
|
||||
<strong>
|
||||
{' '}
|
||||
{t('show_exist', { keyPrefix: 'question_detail' })}
|
||||
</strong>
|
||||
</a>
|
||||
) : (
|
||||
<strong> {flagItemData?.reason_content}</strong>
|
||||
))}
|
||||
</p>
|
||||
</Stack>
|
||||
|
||||
@@ -128,7 +128,7 @@ const Index: FC<Props> = ({ data }) => {
|
||||
<a
|
||||
className="link-secondary"
|
||||
href={
|
||||
data.website?.includes('http')
|
||||
data.website?.startsWith('http')
|
||||
? data.website
|
||||
: `http://${data.website}`
|
||||
}>
|
||||
|
||||
Reference in New Issue
Block a user