From 01ce80fb1a1c152fc55e18f685b1bb755cbb87b2 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 10 Apr 2015 13:30:36 -0600 Subject: [PATCH] fixed direct operations on media objects --- system/src/Grav/Common/Grav.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/src/Grav/Common/Grav.php b/system/src/Grav/Common/Grav.php index 57a749dec..f6e23968b 100644 --- a/system/src/Grav/Common/Grav.php +++ b/system/src/Grav/Common/Grav.php @@ -2,6 +2,7 @@ namespace Grav\Common; use Grav\Common\Filesystem\Folder; +use Grav\Common\Page\Medium\ImageMedium; use Grav\Common\Page\Pages; use Grav\Common\Service\ConfigServiceProvider; use Grav\Common\Service\ErrorServiceProvider; @@ -10,7 +11,6 @@ use Grav\Common\Service\StreamsServiceProvider; use RocketTheme\Toolbox\DI\Container; use RocketTheme\Toolbox\Event\Event; use RocketTheme\Toolbox\Event\EventDispatcher; -use Grav\Common\Page\Medium\Medium; /** * Grav @@ -111,13 +111,13 @@ class Grav extends Container $page = $c['pages']->dispatch($path_parts['dirname'], true); if ($page) { $media = $page->media()->all(); - $media_file = urldecode($uri->basename()); + $media_file = urldecode($path_parts['basename']); // if this is a media object, try actions first if (isset($media[$media_file])) { $medium = $media[$media_file]; foreach ($uri->query(null, true) as $action => $params) { - if (in_array($action, Medium::$valid_actions)) { + if (in_array($action, ImageMedium::$magic_actions)) { call_user_func_array(array(&$medium, $action), explode(',', $params)); } }