Skip to content

Correctly handle files with a hash sign in their names (bug 1894166)#19992

Merged
calixteman merged 1 commit intomozilla:masterfrom
calixteman:hashtag_filename
Jun 20, 2025
Merged

Correctly handle files with a hash sign in their names (bug 1894166)#19992
calixteman merged 1 commit intomozilla:masterfrom
calixteman:hashtag_filename

Conversation

@calixteman
Copy link
Contributor

It fixes #19990.

@calixteman calixteman requested review from timvandermeij and removed request for Snuffleupagus June 19, 2025 12:10
Copy link
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me; thank you for improving this!

@calixteman
Copy link
Contributor Author

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/48b6edf72d304ce/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/ca37b10111a6872/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/48b6edf72d304ce/output.txt

Total script time: 13.34 mins

  • Integration Tests: FAILED

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/ca37b10111a6872/output.txt

Total script time: 30.14 mins

  • Integration Tests: FAILED

@calixteman
Copy link
Contributor Author

/botio unittest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/3775e75d094f5ec/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_unittest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/e404a6a8c3314b0/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/3775e75d094f5ec/output.txt

Total script time: 2.58 mins

  • Unit Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/e404a6a8c3314b0/output.txt

Total script time: 7.71 mins

  • Unit Tests: Passed

@calixteman calixteman merged commit 84d1703 into mozilla:master Jun 20, 2025
9 checks passed
@calixteman calixteman deleted the hashtag_filename branch June 20, 2025 10:52
let decoded = decodeURIComponent(name);
if (decoded.includes("/")) {
decoded = decoded.split("/").at(-1);
if (decoded.test(/^\.pdf$/i)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Cannot display full file name if it contains sharp symbol (#)

6 participants