Correctly handle files with a hash sign in their names (bug 1894166)#19992
Correctly handle files with a hash sign in their names (bug 1894166)#19992calixteman merged 1 commit intomozilla:masterfrom
Conversation
9c7cfdc to
9b06fd5
Compare
9b06fd5 to
f55b092
Compare
timvandermeij
left a comment
There was a problem hiding this comment.
r=me; thank you for improving this!
f55b092 to
b97cee2
Compare
|
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/48b6edf72d304ce/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/ca37b10111a6872/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/48b6edf72d304ce/output.txt Total script time: 13.34 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/ca37b10111a6872/output.txt Total script time: 30.14 mins
|
|
/botio unittest |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/3775e75d094f5ec/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/e404a6a8c3314b0/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/3775e75d094f5ec/output.txt Total script time: 2.58 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/e404a6a8c3314b0/output.txt Total script time: 7.71 mins
|
| let decoded = decodeURIComponent(name); | ||
| if (decoded.includes("/")) { | ||
| decoded = decoded.split("/").at(-1); | ||
| if (decoded.test(/^\.pdf$/i)) { |
There was a problem hiding this comment.
@calixteman While rebasing patches I noticed this new code, and as far as I can tell this line will always throw!? Currently that's obscured by it being placed inside a try-block.
Here decoded is a string, and String-instances don't have a test-method; try running the following in the console:
var decoded = "abc";
decoded.test(/^\.pdf$/i)which results in:
Uncaught TypeError: decoded.test is not a function
<anonymous> debugger eval code:2
debugger eval code:2:9
This can be "fixed" by swapping the order, i.e. /^\.pdf$/i.test(decoded), however I don't really understand this code to know if that's correct.
It fixes #19990.