@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix Firefox upload fatal

Summary:
Several problems:

- With fpm-warmup, 'PhabricatorAccessLog' is always loaded, even if it hasn't actually initialized. Use a global instead (barf). I'll fix this when I refactor index.php, hopefully soon.
- The 'POST' check isn't sufficient in Firefox for HTML5 uploads -- not 100% sure why, maybe it encodes post bodies differently? I added an additional '__file__' requirement, and will add this param to GET on all file uploads in a future diff.

See discussion in D2381.

Test Plan: Uploaded files with Firefox via drag-and-drop without various mysterious errors.

Reviewers: vrana, btrahan, jungejason

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D2405

+11 -10
+11 -10
webroot/index.php
··· 17 17 */ 18 18 19 19 $__start__ = microtime(true); 20 + $access_log = null; 20 21 21 22 error_reporting(E_ALL | E_STRICT); 22 23 23 - if ($_SERVER['REQUEST_METHOD'] == 'POST' && !$_POST) { 24 + if ($_SERVER['REQUEST_METHOD'] == 'POST' && !$_POST && 25 + isset($_REQUEST['__file__'])) { 24 26 $size = ini_get('post_max_size'); 25 27 phabricator_fatal( 26 28 "Request size exceeds PHP 'post_max_size' ('{$size}')."); ··· 353 355 } 354 356 355 357 function phabricator_fatal($msg) { 356 - if (class_exists('PhabricatorAccessLog', false)) { 357 - $log = PhabricatorAccessLog::getLog(); 358 - if ($log) { 359 - $log->setData( 360 - array( 361 - 'c' => 500, 362 - )); 363 - $log->write(); 364 - } 358 + 359 + global $access_log; 360 + if ($access_log) { 361 + $access_log->setData( 362 + array( 363 + 'c' => 500, 364 + )); 365 + $access_log->write(); 365 366 } 366 367 367 368 header(