From fb3b1a1f58b6e23ddabda01765586535685d32dd Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 14 Feb 2024 22:13:59 +0200 Subject: [PATCH] make strict transaction request --- src/Controller/MainController.php | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 39804da..4960a76 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -128,30 +128,27 @@ class MainController extends AbstractController { $index = new \Kvazar\Index\Manticore(); - $records = $index->get( + foreach ($index->get( '', [ 'crc32_transaction' => crc32( $request->get('transaction') ) ] - ); - - if (empty($records)) + ) as $record) { - throw $this->createNotFoundException(); + if ($record['transaction'] === $request->get('transaction')) + { + return $this->render( + 'default/main/transaction.html.twig', + [ + 'request' => $request, + 'record' => $record + ] + ); + } } - $record = reset( - $records - ); - - return $this->render( - 'default/main/transaction.html.twig', - [ - 'request' => $request, - 'record' => $record - ] - ); + throw $this->createNotFoundException(); } } \ No newline at end of file