Page MenuHomePhorge

T15866 suppress HTTP 400 error

Authored By
aklapper
Jun 24 2024, 15:28
Size
1 KB
Referenced Files
None
Subscribers
None

T15866 suppress HTTP 400 error

diff --git a/src/aphront/AphrontRequest.php b/src/aphront/AphrontRequest.php
index 2561e397b6..4337577c3e 100644
--- a/src/aphront/AphrontRequest.php
+++ b/src/aphront/AphrontRequest.php
@@ -705,7 +705,7 @@ final class AphrontRequest extends Phobject {
}
public function isPreviewRequest() {
- return $this->isFormPost() && $this->getStr('__preview__');
+ return $this->getStr('__preview__');
}
/**
diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php
index a696fb6cf7..2021da3615 100644
--- a/src/applications/transactions/editengine/PhabricatorEditEngine.php
+++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php
@@ -1892,10 +1892,11 @@ abstract class PhabricatorEditEngine
$controller = $this->getController();
$request = $controller->getRequest();
+ $is_preview = $request->isPreviewRequest();
// NOTE: We handle hisec inside the transaction editor with "Sign With MFA"
// comment actions.
- if (!$request->isFormOrHisecPost()) {
+ if (!$request->isFormOrHisecPost() && !$is_preview) {
return new Aphront400Response();
}
@@ -1911,7 +1912,6 @@ abstract class PhabricatorEditEngine
$fields = $this->buildEditFields($object);
- $is_preview = $request->isPreviewRequest();
$view_uri = $this->getEffectiveObjectViewURI($object);
$template = $object->getApplicationTransactionTemplate();

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
739095
Default Alt Text
T15866 suppress HTTP 400 error (1 KB)

Event Timeline