From 9e6507d37aef1ed5273ce7b28935064d836d8a26 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Thu, 15 Aug 2024 15:57:54 +0200 Subject: [PATCH] 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 --- .../conpherence/controller/ConpherenceViewController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/applications/conpherence/controller/ConpherenceViewController.php b/src/applications/conpherence/controller/ConpherenceViewController.php index 357d07631a..4ac953a0e2 100644 --- a/src/applications/conpherence/controller/ConpherenceViewController.php +++ b/src/applications/conpherence/controller/ConpherenceViewController.php @@ -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';