1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 13:30:55 +01:00

Fix exception handling in ConpherenceViewController::handleRequest()

Summary:
It is only possible `throw` an `Exception` class. `Aphront400Response` is not an Exception class but a `Phobject`.
Thus `return` it, like the `Aphront404Response`s within the same method.

Test Plan:
Check parent classes; run static code analysis. Hack the code to force that return,
and successfully obtain an HTTP 400 status code page.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25780
This commit is contained in:
Andre Klapper 2024-08-15 15:57:54 +02:00
parent b4bc480817
commit 9e6507d37a

View file

@ -27,10 +27,10 @@ final class ConpherenceViewController extends
$after_transaction_id = $request->getInt('newest_transaction_id');
$old_message_id = $request->getURIData('messageID');
if ($before_transaction_id && ($old_message_id || $after_transaction_id)) {
throw new Aphront400Response();
return new Aphront400Response();
}
if ($old_message_id && $after_transaction_id) {
throw new Aphront400Response();
return new Aphront400Response();
}
$marker_type = 'older';