From a8359af2e3770ccf4fc912e813ad469460da61fc Mon Sep 17 00:00:00 2001 From: flashwave <me@flash.moe> Date: Fri, 17 Jan 2025 00:44:01 +0000 Subject: [PATCH] Fixed issues with EEPROM file extensions. --- src/Lookup/EEPROMLookup.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Lookup/EEPROMLookup.php b/src/Lookup/EEPROMLookup.php index 9a66613..60d6de9 100644 --- a/src/Lookup/EEPROMLookup.php +++ b/src/Lookup/EEPROMLookup.php @@ -61,7 +61,9 @@ final class EEPROMLookup implements \Uiharu\ILookup { if(!isset($fileId)) throw new RuntimeException('Was unable to find EEPROM file id.'); - if(!preg_match('#^([A-Za-z0-9-_]+)$#', $fileId)) + + $fileId = pathinfo($fileId, PATHINFO_FILENAME); + if(!is_string($fileId) || !preg_match('#^([A-Za-z0-9-_]+)$#', $fileId)) throw new RuntimeException('Invalid EEPROM file id format.'); $fileInfo = $this->rawLookup($fileId);