Page MenuHomePhabricator

Allow Phabricator to run with "enable_post_data_reading" disabled
ClosedPublic

Authored by epriestley on Oct 10 2017, 10:26 PM.
Tags
None
Referenced Files
F19938788: D18702.diff
Tue, Apr 14, 7:06 AM
F19934613: D18702.id44894.diff
Sat, Apr 11, 5:01 PM
F19924087: D18702.id44907.diff
Tue, Apr 7, 5:26 AM
F19906294: D18702.id44906.diff
Tue, Mar 31, 10:33 PM
F19867369: D18702.id.diff
Mar 14 2026, 11:34 PM
F19621137: D18702.diff
Feb 4 2026, 1:03 PM
F18920009: D18702.id44894.diff
Nov 9 2025, 12:31 PM
F18901628: D18702.diff
Nov 7 2025, 10:33 PM
Subscribers
None

Details

Summary

Ref T13008. Depends on D18701. The overall goal here is to make turning enable_post_data_reading off not break things, so we can run rate limiting checks before we read file uploads.

The biggest blocker for this is that turning it off stops $_FILES from coming into existence.

This appears to mostly work. Specifically:

  • Skip the max_post_size check when POST is off, since it's meaningless.
  • Don't read or scrub $_POST at startup when POST is off.
  • When we rebuild REQUEST and POST before processing requests, do multipart parsing if we need to and rebuild FILES.
  • Skip the is_uploaded_file() check if we built FILES ourselves.

This probably breaks a couple of small things, like maybe __profile__ and other DarkConsole triggers over POST, and probably some other weird stuff. The parsers may also need more work than they've received so far.

I also need to verify that this actually works (i.e., lets us run code without reading the request body) but I'll include that in the change where I update the actual rate limiting.

Test Plan
  • Disabled enable_post_data_reading.
  • Uploaded a file with a vanilla upload form (project profile image).
  • Uploaded a file with drag and drop.
  • Used DarkConsole.
  • Submitted comments.
  • Created a task.
  • Browsed around.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

amckinley added inline comments.
src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
17–18

This comment needs to be updated, no?

This revision is now accepted and ready to land.Oct 13 2017, 7:43 PM
  • Rewrite explanatory comment.
This revision was automatically updated to reflect the committed changes.