From 7c2d04008df30360e5d9a2a53f42d77fa10757ea Mon Sep 17 00:00:00 2001 From: Jacek Kowalski <Jacek@jacekk.info> Date: Sat, 17 Aug 2024 20:08:50 +0000 Subject: [PATCH] Implement a timeout on fetch request --- lib/VehicleTypes.php | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lib/VehicleTypes.php b/lib/VehicleTypes.php index 5d96326..087391e 100644 --- a/lib/VehicleTypes.php +++ b/lib/VehicleTypes.php @@ -17,8 +17,9 @@ } public function getByNumber($id) { + $id = intval($id, 10); return $this->typesByNumber[$id] ?? [ - 'num' => '??'.$id, + 'num' => '??' . str_pad($id, 3, '0', STR_PAD_LEFT), 'type' => '?', 'low' => NULL, ]; -- Gitblit v1.9.1