diff --git a/CHANGELOG.md b/CHANGELOG.md index d35a69eef..b7c41bc5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# v0.9.15 +## 01/23/2015 + +3. [](#bugfix) + * Typo in video mime types + * Fix for old `markdown_extra` system setting not getting picked up + * Fix in regex for Markdown links with numeric values in path + * Fix for broken image routing mechanism that got broken at some point + * Fix for markdown images/links in pages with page slug override + # v0.9.14 ## 01/23/2015 diff --git a/system/config/media.yaml b/system/config/media.yaml index f5a4795da..057d8be91 100644 --- a/system/config/media.yaml +++ b/system/config/media.yaml @@ -52,19 +52,19 @@ mp3: ogg: type: audio thumb: media/thumb-ogg.png - mine: audio/ogg + mime: audio/ogg wma: type: audio thumb: media/thumb-wma.png - mine: audio/wma + mime: audio/wma m4a: type: audio thumb: media/thumb-m4a.png - mine: audio/m4a + mime: audio/m4a wav: type: audio thumb: media/thumb-wav.png - mine: audio/wav + mime: audio/wav txt: type: file diff --git a/system/defines.php b/system/defines.php index 81e161036..e87129e07 100644 --- a/system/defines.php +++ b/system/defines.php @@ -2,7 +2,7 @@ // Some standard defines define('GRAV', true); -define('GRAV_VERSION', '0.9.14'); +define('GRAV_VERSION', '0.9.15'); define('DS', '/'); // Directories and Paths diff --git a/system/src/Grav/Common/Grav.php b/system/src/Grav/Common/Grav.php index aa5ef997c..2d39ae4dd 100644 --- a/system/src/Grav/Common/Grav.php +++ b/system/src/Grav/Common/Grav.php @@ -107,26 +107,24 @@ class Grav extends Container if (!$page || !$page->routable()) { // special case where a media file is requested - if (!$page) { - $path_parts = pathinfo($path); + $path_parts = pathinfo($path); - $page = $c['pages']->dispatch($path_parts['dirname']); - if ($page) { - $media = $page->media()->all(); - $media_file = urldecode($path_parts['basename']); - if (isset($media[$media_file])) { - $medium = $media[$media_file]; + $page = $c['pages']->dispatch($path_parts['dirname']); + if ($page) { + $media = $page->media()->all(); + $media_file = urldecode($path_parts['basename']); + if (isset($media[$media_file])) { + $medium = $media[$media_file]; - // loop through actions for the image and call them - foreach ($c['uri']->query(null, true) as $action => $params) { - if (in_array($action, Medium::$valid_actions)) { - call_user_func_array(array(&$medium, $action), explode(',', $params)); - } + // loop through actions for the image and call them + foreach ($c['uri']->query(null, true) as $action => $params) { + if (in_array($action, Medium::$valid_actions)) { + call_user_func_array(array(&$medium, $action), explode(',', $params)); } - header('Content-type: '. $mime = $medium->get('mime')); - echo file_get_contents($medium->path()); - die; } + header('Content-type: '. $medium->get('mime')); + echo file_get_contents($medium->path()); + die; } } diff --git a/system/src/Grav/Common/Markdown/ParsedownGravTrait.php b/system/src/Grav/Common/Markdown/ParsedownGravTrait.php index 2cd116cbb..b893fa60c 100644 --- a/system/src/Grav/Common/Markdown/ParsedownGravTrait.php +++ b/system/src/Grav/Common/Markdown/ParsedownGravTrait.php @@ -210,17 +210,17 @@ trait ParsedownGravTrait { // if absolute and starts with a base_url move on if ($this->base_url != '' && strpos($markdown_url, $this->base_url) === 0) { - $new_url = $markdown_url; + return $markdown_url; // if its absolute and starts with / } elseif (strpos($markdown_url, '/') === 0) { - $new_url = $this->base_url . $markdown_url; + return $this->base_url . $markdown_url; } else { $relative_path = $this->base_url . $this->page->route(); + $real_path = $this->page->path() . '/' . parse_url($markdown_url, PHP_URL_PATH); - // If this is a 'real' filepath clean it up - if (file_exists($this->page->path() . '/' . parse_url($markdown_url, PHP_URL_PATH))) { - $relative_path = $this->base_url . preg_replace('/\/([\d]+.)/', '/', str_replace($this->pages_dir, '', $this->page->path())); - $markdown_url = preg_replace('/^([\d]+.)/', '', preg_replace('/\/([\d]+.)/', '/', trim(preg_replace('/[^\/]+(\.md$)/', '', $markdown_url), '/'))); + // strip numeric order from markdown path + if (($real_path)) { + $markdown_url = preg_replace('/^([\d]+\.)/', '', preg_replace('/\/([\d]+\.)/', '/', trim(preg_replace('/[^\/]+(\.md$)/', '', $markdown_url), '/'))); } // else its a relative path already diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index feeb449a8..e5d7698d6 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -419,7 +419,7 @@ class Page // pages.markdown_extra is deprecated, but still check it... if (isset($this->markdown_extra) || $config->get('system.pages.markdown_extra') !== null) { - $defaults['extra'] = $this->markdown_extra; + $defaults['extra'] = $this->markdown_extra ?: $config->get('system.pages.markdown_extra'); } // Initialize the preferred variant of Parsedown