From 0e8208004516091f629b9aef7b4c2a63b754ce49 Mon Sep 17 00:00:00 2001 From: Andreas Resch Date: Thu, 4 Jul 2024 08:39:44 +0200 Subject: [PATCH] fix filename parsing --- .gitignore | 1 + surrogator.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b3d2101..b9296ac 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ www/robots.txt build.properties dist/ /vendor/ +/.idea/ diff --git a/surrogator.php b/surrogator.php index b397042..0b66c8a 100755 --- a/surrogator.php +++ b/surrogator.php @@ -205,7 +205,7 @@ function getHashes($fileName) //OpenIDs have their slashes "/" url-encoded $fileName = rawurldecode($fileName); - $fileNameNoExt = substr($fileName, 0, -strlen(strrpos($fileName, '.')) - 2); + $fileNameNoExt = pathinfo($fileName, PATHINFO_FILENAME); $emailAddress = trim(strtolower($fileNameNoExt)); return array( -- 2.30.2