diff --git a/CHANGELOG.md b/CHANGELOG.md index a5d5404b29..d6b56ffe5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# v1.4.7 +## 07/13/2018 + +1. [](#improved) + * Use `getFilename` instead of `getBasename` [#2087](https://github.com/getgrav/grav/issues/2087) +1. [](#bugfix) + * Fix for modular page preview [#2066](https://github.com/getgrav/grav/issues/2066) + * `Page::routeCanonical()` should be string not array [#2069](https://github.com/getgrav/grav/issues/2069) + # v1.4.6 ## 06/20/2018 diff --git a/system/defines.php b/system/defines.php index 28c4434f09..5e737f5904 100644 --- a/system/defines.php +++ b/system/defines.php @@ -8,7 +8,7 @@ // Some standard defines define('GRAV', true); -define('GRAV_VERSION', '1.4.6'); +define('GRAV_VERSION', '1.4.7'); define('GRAV_TESTING', false); define('DS', '/'); diff --git a/system/src/Grav/Common/Config/ConfigFileFinder.php b/system/src/Grav/Common/Config/ConfigFileFinder.php index 7980671754..83b13ec350 100644 --- a/system/src/Grav/Common/Config/ConfigFileFinder.php +++ b/system/src/Grav/Common/Config/ConfigFileFinder.php @@ -207,7 +207,7 @@ protected function detectInFolder($folder, $lookup = null) continue; } - $name = $directory->getBasename(); + $name = $directory->getFilename(); $find = ($lookup ?: $name) . '.yaml'; $filename = "{$path}/{$name}/{$find}"; diff --git a/system/src/Grav/Common/GPM/Installer.php b/system/src/Grav/Common/GPM/Installer.php index 6c385b8d82..f16cdcca84 100644 --- a/system/src/Grav/Common/GPM/Installer.php +++ b/system/src/Grav/Common/GPM/Installer.php @@ -296,17 +296,17 @@ public static function sophisticatedInstall($source_path, $install_path, $ignore { foreach (new \DirectoryIterator($source_path) as $file) { - if ($file->isLink() || $file->isDot() || in_array($file->getBasename(),$ignores)) { + if ($file->isLink() || $file->isDot() || in_array($file->getFilename(), $ignores)) { continue; } - $path = $install_path . DS . $file->getBasename(); + $path = $install_path . DS . $file->getFilename(); if ($file->isDir()) { Folder::delete($path); Folder::move($file->getPathname(), $path); - if ($file->getBasename() == 'bin') { + if ($file->getFilename() === 'bin') { foreach (glob($path . DS . '*') as $bin_file) { @chmod($bin_file, 0755); } diff --git a/system/src/Grav/Common/Page/Media.php b/system/src/Grav/Common/Page/Media.php index bd97cb2e25..4f2226547b 100644 --- a/system/src/Grav/Common/Page/Media.php +++ b/system/src/Grav/Common/Page/Media.php @@ -86,7 +86,7 @@ protected function init() /** @var \DirectoryIterator $info */ foreach ($iterator as $path => $info) { // Ignore folders and Markdown files. - if (!$info->isFile() || $info->getExtension() === 'md' || $info->getBasename()[0] === '.') { + if (!$info->isFile() || $info->getExtension() === 'md' || $info->getFilename()[0] === '.') { continue; } diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index e92e03bffb..3954efe26d 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -1790,7 +1790,7 @@ public function routeAliases($var = null) public function routeCanonical($var = null) { if ($var !== null) { - $this->routes['canonical'] = (array)$var; + $this->routes['canonical'] = $var; } if (!empty($this->routes) && isset($this->routes['canonical'])) { diff --git a/system/src/Grav/Common/Page/Pages.php b/system/src/Grav/Common/Page/Pages.php index 12afa7e88d..5658b78b13 100644 --- a/system/src/Grav/Common/Page/Pages.php +++ b/system/src/Grav/Common/Page/Pages.php @@ -1041,7 +1041,7 @@ function ($str) { } // Ignore all files in ignore list. - if (\in_array($file->getBasename(), $this->ignore_files, true)) { + if (\in_array($filename, $this->ignore_files, true)) { continue; } diff --git a/system/src/Grav/Common/Plugins.php b/system/src/Grav/Common/Plugins.php index 5e407a905d..2a9d523811 100644 --- a/system/src/Grav/Common/Plugins.php +++ b/system/src/Grav/Common/Plugins.php @@ -33,7 +33,7 @@ public function __construct() if (!$directory->isDir()) { continue; } - $plugins[] = $directory->getBasename(); + $plugins[] = $directory->getFilename(); } natsort($plugins); diff --git a/system/src/Grav/Common/Themes.php b/system/src/Grav/Common/Themes.php index 8f29037dd7..bf86d8dc66 100644 --- a/system/src/Grav/Common/Themes.php +++ b/system/src/Grav/Common/Themes.php @@ -98,7 +98,7 @@ public function all() continue; } - $theme = $directory->getBasename(); + $theme = $directory->getFilename(); $result = self::get($theme); if ($result) { diff --git a/system/src/Grav/Common/Twig/Twig.php b/system/src/Grav/Common/Twig/Twig.php index a47a2b7aa8..c0b24db51b 100644 --- a/system/src/Grav/Common/Twig/Twig.php +++ b/system/src/Grav/Common/Twig/Twig.php @@ -238,7 +238,7 @@ public function processPage(Page $item, $content = null) // Process Modular Twig if ($item->modularTwig()) { $twig_vars['content'] = $content; - $extension = $this->grav['uri']->extension(); + $extension = $item->templateFormat(); $extension = $extension ? ".{$extension}.twig" : TEMPLATE_EXT; $template = $item->template() . $extension; $output = $content = $local_twig->render($template, $twig_vars);