qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
28.04k stars 3.96k forks source link

External program not running if torrent name/folder has ampersands #14325

Open RivenSkaye opened 3 years ago

RivenSkaye commented 3 years ago

qBittorrent version and Operating System

qBT 4.3.1 on Windows 10 (10.0.1xxxx)

If on linux, libtorrent-rasterbar and Qt version

N/A

What is the problem

External command/program is not being run properly if the torrent name and/or content directory contain ampersands (&). Copy-pasting the line from the log file into either the Run dialog or into CMD.exe works just fine, the command itself is just sending some info about the torrent to a script C:\Utilities\mkpls.cmd "%F" "%L" %C (the script internally runs a few commands to create a playlist file based on the category and the amount of files in the torrent). Works on most, if not all torrents except for torrents where the name contains an ampersand. Can provide the torrent and content folder name if needed, it downloads just fine.

What is the expected behavior

Command runs as it would through either CMD.exe or the Run dialog

Steps to reproduce

Download any torrent that produces ampersands in its content path and set up the client to pass that on to a script. Not quoting causes the expected problems of the string being parsed as several commands, quoting causes silent failure.

Extra info(if any)

Have not had any other issues with regards to content folder names, but I can imagine certain special characters can cause platform-specific issues. This is not yet certain.

luzpaz commented 1 year ago

Related to #18457

RivenSkaye commented 1 year ago

This is not related as far as I can tell, since this seems to be a problem with parsing and escaling text so an external runner can properly process it. Which has nothing to do with actions taken when qBT itself errors

luzpaz commented 1 year ago

@Chocobo1 is this issue impacted by a427b9228d8e3c7d45ce2c1e560ba307eb6c475d ?

Chocobo1 commented 1 year ago

@Chocobo1 is this issue impacted by https://github.com/qbittorrent/qBittorrent/commit/a427b9228d8e3c7d45ce2c1e560ba307eb6c475d ?

That is not related.