Merge branch 'release/0.9.15'

This commit is contained in:
Andy Miller
2015-01-23 17:22:57 -07:00
6 changed files with 36 additions and 28 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;
}
}

View File

@@ -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

View File

@@ -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