From 9277381527cde4b6a0de3af2b871cf9ed13df2bc Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sun, 21 May 2017 16:23:27 -0600 Subject: [PATCH] Fix for inefficient path parts --- system/src/Grav/Common/Page/Medium/MediumFactory.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/src/Grav/Common/Page/Medium/MediumFactory.php b/system/src/Grav/Common/Page/Medium/MediumFactory.php index 2f1a72b0f..9c6a0a536 100644 --- a/system/src/Grav/Common/Page/Medium/MediumFactory.php +++ b/system/src/Grav/Common/Page/Medium/MediumFactory.php @@ -26,11 +26,11 @@ class MediumFactory return null; } - $path = dirname($file); - $filename = basename($file); - $parts = explode('.', $filename); - $ext = array_pop($parts); - $basename = implode('.', $parts); + $parts = pathinfo($file); + $path = $parts['dirname']; + $filename = $parts['basename']; + $ext = $parts['extension']; + $basename = $parts['filename']; $config = Grav::instance()['config'];