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

show the current size limit when a file upload fails

Summary: Show the php.ini setting for max upload or alterantively the in phabricator configured one. Fixes T6663

Test Plan: changed php.ini and alternatively phabricator file upload size settings to minimal values and try to upload a larger file

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, btrahan, chad, epriestley

Maniphest Tasks: T6663

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

authored by

Fabian Stelzer and committed by
epriestley
6132d801 a366f85c

+6 -4
+6 -4
src/applications/files/exception/PhabricatorFileUploadException.php
··· 5 5 public function __construct($code) { 6 6 $map = array( 7 7 UPLOAD_ERR_INI_SIZE => 8 - "Uploaded file is too large: file is larger than the ". 9 - "'upload_max_filesize' setting in php.ini.", 8 + pht("Uploaded file is too large: current limit is %s. To adjust ". 9 + "this limit change 'upload_max_filesize' in php.ini.", 10 + ini_get('upload_max_filesize')), 10 11 UPLOAD_ERR_FORM_SIZE => 11 12 'File is too large.', 12 13 UPLOAD_ERR_PARTIAL => ··· 21 22 'Unable to upload: a PHP extension stopped the upload.', 22 23 23 24 -1000 => 24 - "Uploaded file exceeds limit in Phabricator ". 25 - "'storage.upload-size-limit' configuration.", 25 + pht("Uploaded file is too large: current limit is %s. To adjust this ". 26 + "limit change 'storage.upload-size-limit' in the Phabricator config.", 27 + PhabricatorEnv::getEnvConfig('storage.upload-size-limit')), 26 28 ); 27 29 28 30 $message = idx($map, $code, 'Upload failed: unknown error.');