Homestyx hydra
Diffusion hydra 0a82ccb8a4b0

AphrontFileResponse: avoid alien usages of setDownload()

Description

AphrontFileResponse: avoid alien usages of setDownload()

Summary:
I noticed that - historically - setDownload() could also be used with
false, true, or other weird values to activate a download filename.
So, this change continues to give full compatibility to PHP 8.1 but
with extra validations.

This also adds a bit of inline documentation to put this more explicit.

For more context see the previous version:

R1:5952b0a31b6a: Stop mangling filenames when downloading them

R1:96ae4ba13acb: PHP 8.1: fixes for strlen() not accepting NULL anymore, part 2

Ref T15190

Test Plan:

  • Drop a file in a comment, click, download
  • See that it still works

Reviewers: O1 Blessed Committers, Cigaryno, avivey

Reviewed By: O1 Blessed Committers, Cigaryno, avivey

Subscribers: avivey, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15190

Differential Revision: https://we.phorge.it/D25113

Details

Provenance
Valerio BozzolanAuthored on Apr 9 2023, 4:45 PM
sirocylPushed on Oct 16 2024, 5:49 AM
Parents
R1:d46aab832118: Add GitHub mirror to list of known mirrors
Branches
Unknown
Tags
Unknown

Event Timeline