Trim extra spaces off pasted magnet links
Before this change, using the "Open Torrent Address" dialog to paste a magnet link would fail with leading or trailing spaces. Pasting on the torrent list page has always trimmed. So this PR just makes it consistent.
This commit is contained in:
@@ -25,6 +25,11 @@ module.exports = class TorrentListController {
|
|||||||
torrentId = torrentId.path
|
torrentId = torrentId.path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Trim extra spaces off pasted magnet links
|
||||||
|
if (typeof torrentId === 'string') {
|
||||||
|
torrentId = torrentId.trim()
|
||||||
|
}
|
||||||
|
|
||||||
// Allow a instant.io link to be pasted
|
// Allow a instant.io link to be pasted
|
||||||
if (typeof torrentId === 'string' && instantIoRegex.test(torrentId)) {
|
if (typeof torrentId === 'string' && instantIoRegex.test(torrentId)) {
|
||||||
torrentId = torrentId.slice(torrentId.indexOf('#') + 1)
|
torrentId = torrentId.slice(torrentId.indexOf('#') + 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user