add validation for uri
This commit is contained in:
parent
6d820058dc
commit
4935083fef
1 changed files with 2 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
// @flow
|
||||
import * as React from 'react';
|
||||
import { MODALS } from 'lbry-redux';
|
||||
import { MODALS, isURIValid } from 'lbry-redux';
|
||||
import Button from 'component/button';
|
||||
|
||||
type Props = {
|
||||
|
@ -43,7 +43,7 @@ class ExternalLink extends React.PureComponent<Props> {
|
|||
}
|
||||
|
||||
// Return local link if protocol is lbry uri
|
||||
if (protocol && protocol[0] === 'lbry:') {
|
||||
if (protocol && protocol[0] === 'lbry:' && isURIValid(href)) {
|
||||
element = (
|
||||
<Button button="link" title={title} onClick={() => navigate('/show', { uri: href })}>
|
||||
{children}
|
||||
|
|
Loading…
Reference in a new issue