From 99f404fe3dfdee68ef4bbb92681eb59b03c616d6 Mon Sep 17 00:00:00 2001 From: vnmedeiros Date: Tue, 5 Nov 2024 16:16:21 -0300 Subject: [PATCH] feat: adjustment on function `get_file_name_from_url` #929 --- src/classes/class-tainacan-media.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/classes/class-tainacan-media.php b/src/classes/class-tainacan-media.php index ed9a3287c..ae6133a39 100644 --- a/src/classes/class-tainacan-media.php +++ b/src/classes/class-tainacan-media.php @@ -64,14 +64,10 @@ class Media { if (isset($headers['content-disposition'])) { if (preg_match('/filename="([^"]+)"/', $headers['content-disposition'], $matches)) { $fileName = $matches[1]; + return $fileName; } } - - if (!$fileName) { - $fileName = basename($path); - } - - return $fileName; + return basename($path); } /**