fix: unsafe external link (#2356)

This commit is contained in:
Joel 2024-02-02 15:42:42 +08:00 committed by GitHub
parent 04fb610fe7
commit 5a004ae429
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 12 additions and 12 deletions

View File

@ -100,7 +100,7 @@ const ActivateForm = () => {
'md:px-[108px]', 'md:px-[108px]',
) )
}> }>
{!checkRes && <Loading/>} {!checkRes && <Loading />}
{checkRes && !checkRes.is_valid && ( {checkRes && !checkRes.is_valid && (
<div className="flex flex-col md:w-[400px]"> <div className="flex flex-col md:w-[400px]">
<div className="w-full mx-auto"> <div className="w-full mx-auto">
@ -206,7 +206,7 @@ const ActivateForm = () => {
&nbsp; &nbsp;
<Link <Link
className='text-primary-600' className='text-primary-600'
target={'_blank'} target='_blank' rel='noopener noreferrer'
href={`https://docs.dify.ai/${language !== LanguagesSupportedUnderscore[1] ? 'user-agreement' : `v/${locale.toLowerCase()}/policies`}/open-source`} href={`https://docs.dify.ai/${language !== LanguagesSupportedUnderscore[1] ? 'user-agreement' : `v/${locale.toLowerCase()}/policies`}/open-source`}
>{t('login.license.link')}</Link> >{t('login.license.link')}</Link>
</div> </div>

View File

@ -144,7 +144,7 @@ export function Markdown(props: { content: string; className?: string }) {
) )
}, },
}} }}
linkTarget={'_blank'} linkTarget='_blank'
> >
{/* Markdown detect has problem. */} {/* Markdown detect has problem. */}
{props.content} {props.content}

View File

@ -45,7 +45,7 @@ export default function IntegrationsPage() {
<Link <Link
className='flex items-center h-8 px-[7px] bg-white rounded-lg border border-gray-200 text-xs font-medium text-gray-700 cursor-pointer' className='flex items-center h-8 px-[7px] bg-white rounded-lg border border-gray-200 text-xs font-medium text-gray-700 cursor-pointer'
href={integrate.link} href={integrate.link}
target={'_blank'}> target='_blank' rel='noopener noreferrer'>
{t('common.integrations.connect')} {t('common.integrations.connect')}
</Link> </Link>
) )

View File

@ -108,7 +108,7 @@ const KeyValidator = ({
/> />
)) ))
} }
<a className="flex items-center text-xs cursor-pointer text-primary-600" href={keyFrom.link} target={'_blank'}> <a className="flex items-center text-xs cursor-pointer text-primary-600" href={keyFrom.link} target='_blank' rel='noopener noreferrer'>
{keyFrom.text} {keyFrom.text}
<LinkExternal02 className='w-3 h-3 ml-1 text-primary-600' /> <LinkExternal02 className='w-3 h-3 ml-1 text-primary-600' />
</a> </a>

View File

@ -300,7 +300,7 @@ const ModelModal: FC<ModelModalProps> = ({
{t('common.modelProvider.encrypted.front')} {t('common.modelProvider.encrypted.front')}
<a <a
className='text-primary-600 mx-1' className='text-primary-600 mx-1'
target={'_blank'} target='_blank' rel='noopener noreferrer'
href='https://pycryptodome.readthedocs.io/en/latest/src/cipher/oaep.html' href='https://pycryptodome.readthedocs.io/en/latest/src/cipher/oaep.html'
> >
PKCS1_OAEP PKCS1_OAEP

View File

@ -24,7 +24,7 @@ const PluginPage = () => {
{t('common.provider.encrypted.front')} {t('common.provider.encrypted.front')}
<Link <Link
className='text-primary-600 mx-1' className='text-primary-600 mx-1'
target={'_blank'} target='_blank' rel='noopener noreferrer'
href='https://pycryptodome.readthedocs.io/en/latest/src/cipher/oaep.html' href='https://pycryptodome.readthedocs.io/en/latest/src/cipher/oaep.html'
> >
PKCS1_OAEP PKCS1_OAEP

View File

@ -175,7 +175,7 @@ const InstallForm = () => {
&nbsp; &nbsp;
<Link <Link
className='text-primary-600' className='text-primary-600'
target={'_blank'} target='_blank' rel='noopener noreferrer'
href={'https://docs.dify.ai/user-agreement/open-source'} href={'https://docs.dify.ai/user-agreement/open-source'}
>{t('login.license.link')}</Link> >{t('login.license.link')}</Link>
</div> </div>

View File

@ -282,13 +282,13 @@ const NormalForm = () => {
&nbsp; &nbsp;
<Link <Link
className='text-primary-600' className='text-primary-600'
target={'_blank'} target='_blank' rel='noopener noreferrer'
href={language !== LanguagesSupportedUnderscore[1] ? 'https://docs.dify.ai/user-agreement/terms-of-service' : 'https://docs.dify.ai/v/zh-hans/user-agreement/terms-of-service'} href={language !== LanguagesSupportedUnderscore[1] ? 'https://docs.dify.ai/user-agreement/terms-of-service' : 'https://docs.dify.ai/v/zh-hans/user-agreement/terms-of-service'}
>{t('login.tos')}</Link> >{t('login.tos')}</Link>
&nbsp;&&nbsp; &nbsp;&&nbsp;
<Link <Link
className='text-primary-600' className='text-primary-600'
target={'_blank'} target='_blank' rel='noopener noreferrer'
href={language !== LanguagesSupportedUnderscore[1] ? 'https://docs.dify.ai/user-agreement/privacy-policy' : 'https://docs.dify.ai/v/zh-hans/user-agreement/privacy-policy'} href={language !== LanguagesSupportedUnderscore[1] ? 'https://docs.dify.ai/user-agreement/privacy-policy' : 'https://docs.dify.ai/v/zh-hans/user-agreement/privacy-policy'}
>{t('login.pp')}</Link> >{t('login.pp')}</Link>
</div> </div>

View File

@ -160,7 +160,7 @@ const OneMoreStep = () => {
&nbsp; &nbsp;
<Link <Link
className='text-primary-600' className='text-primary-600'
target={'_blank'} target='_blank' rel='noopener noreferrer'
href={'https://docs.dify.ai/user-agreement/open-source'} href={'https://docs.dify.ai/user-agreement/open-source'}
>{t('login.license.link')}</Link> >{t('login.license.link')}</Link>
</div> </div>