Skip to content

Commit 90a51c2

Browse files
committed
fix(isMagnetURI): check only string ending after hash or new parameter start
1 parent 3c4157a commit 90a51c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/isMagnetURI.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import assertString from './util/assertString';
22

3-
const magnetURI = /^magnet:\?xt(?:\.1)?=urn:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?(?:&.+)?$/i;
3+
const magnetURI = /^magnet:\?xt(?:\.1)?=urn:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?($|&)/i;
44

55
export default function isMagnetURI(url) {
66
assertString(url);

0 commit comments

Comments
 (0)