Since this commit, /plugins/create/action.phpcmd: "create" is getting unicode non-breaking spaces xC2A0, instead ASCII spaces and throwing errors during torrent creation, when the file name creates a torrent. This is causing non-existing path errors.
Reproduction:
Create a file with spaces in the name dd if=/dev/zero bs=1024 count=1 of="file with spaces.bin"
Open Dev tools network tab, and filter by "plugins/create/action.php"
Select "file with spaces.bin" as your source in the "Create New Torrent" dialog.
Create...
Copy path_edit from the request arguments and convert to hex to observe that the spaces are not ASCII.
Describe the solution you'd like and propose possible alternatives.
It looks like part of that change is juggling between \u00a0 (equal to hex xC2A0) and ascii whitespace. I expect the intention there was to tackle line wraps in the directory selector menu?
I don't fully understand the initial motivation behind the non breaking spaces, but my instinct is that if the nbsp replacements were used for layout purposes, there's probably a CSS trait we could use instead and keep the proper ASCII spaces in the code and avoid juggling between valid strings, and invalid-but-displayed strings.
Provide information and resources about the environment hosting the web client.
What would you like changed about the web client?
Commit https://github.com/Novik/ruTorrent/commit/38c6489e60729fe841a5e6904ea288fd74e1f8fe / https://github.com/Novik/ruTorrent/pull/2768 appears to have introduced a regression with whitespace handling in 5.1 beta 4.
Since this commit,
/plugins/create/action.php
cmd: "create"
is getting unicode non-breaking spacesxC2A0
, instead ASCII spaces and throwing errors during torrent creation, when the file name creates a torrent. This is causing non-existing path errors.Reproduction:
dd if=/dev/zero bs=1024 count=1 of="file with spaces.bin"
path_edit
from the request arguments and convert to hex to observe that the spaces are not ASCII.Describe the solution you'd like and propose possible alternatives.
It looks like part of that change is juggling between \u00a0 (equal to hex
xC2A0
) and ascii whitespace. I expect the intention there was to tackle line wraps in the directory selector menu?When the create plugin is getting the value out, it's using jQuery's
.val()
without any fancy substitution. as seen here: https://github.com/Novik/ruTorrent/blob/v5.1-beta4/plugins/create/init.js#L19I don't fully understand the initial motivation behind the non breaking spaces, but my instinct is that if the nbsp replacements were used for layout purposes, there's probably a CSS trait we could use instead and keep the proper ASCII spaces in the code and avoid juggling between valid strings, and invalid-but-displayed strings.
Provide information and resources about the environment hosting the web client.
Verified using: Firefox 132.0.1 PHP: 8.3.13 OS: Gentoo Linux (rolling release) Install script: Roughly https://gitweb.gentoo.org/repo/gentoo.git/tree/www-apps/rutorrent/rutorrent-4.3.9.ebuild
Create torrent backend is mktorrent.sh / mktorrent 2021-01-30
Additional context
No response