Bug 339584

Summary: Web Interface has problems in loading certain magnet links
Product: [Applications] ktorrent Reporter: Leszek Lesner <leszek.lesner>
Component: generalAssignee: Joris Guisson <joris.guisson>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 4.3.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Patch for action.js

Description Leszek Lesner 2014-10-01 19:41:30 UTC
I was informed by one of our users that ktorrent has problems in the web user interface with opening certain magnet links. 
Example (only for the sake of example): 
This works fine: 
magnet:?xt=urn:btih:385821e75c87064d4a641bb3d6e23c6585d2e8c7&dn=2005+-+System+Of+A+Down+-+Mezmerize+%5BLimited+Edition+Picture+Dis&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A6969&tr=udp%3A%2F%2Fopen.demonii.com%3A1337

This one doesn't:
magnet:?xt=urn:btih:bdd19c5f47cd6ad8c1791e5f2eba898d550fc680&dn=System+Of+A+Down+-+Mezmerize+%282005%29+Flac%5B24+Bit+96KHz+Vinyl%5D&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A6969&tr=udp%3A%2F%2Fopen.demonii.com%3A1337



Reproducible: Always

Steps to Reproduce:
1. Enable Web Interface
2. Try to load "not working marked link"

Actual Results:  
Produces an error (wrong link ?.)

Expected Results:  
Load magnet link. 

I discovered that double escaping the url.value somehow seems to fix this issue. See attached patch
Comment 1 Leszek Lesner 2014-10-01 19:42:05 UTC
Created attachment 88922 [details]
Patch for action.js
Comment 2 Joris Guisson 2014-11-08 11:54:47 UTC
Git commit 2af04ef8e6607625458ca557dd26689503f17789 by Joris Guisson.
Committed on 08/11/2014 at 11:54.
Pushed by guisson into branch 'master'.

Fix some magnet links not working in webinterface plugin
REVIEW: 120808

M  +1    -0    ChangeLog
M  +1    -0    ktorrent/main.cpp
M  +2    -1    plugins/webinterface/www/common/action.js

http://commits.kde.org/ktorrent/2af04ef8e6607625458ca557dd26689503f17789