Merge branch 'release/1.6.26'

This commit is contained in:
Andy Miller
2020-06-08 15:50:24 -06:00
9 changed files with 51 additions and 18 deletions

View File

@@ -1,3 +1,13 @@
# v1.6.26
## 06/08/2020
1. [](#improved)
* Added new configuration option to control the supported attributes in markdown links [#2882](https://github.com/getgrav/grav/issues/2882)
1. [](#bugfix)
* Fixed blueprint for `system.pages.hide_empty_folders` [#1925](https://github.com/getgrav/grav/issues/2925)
* JSON Route of homepage with no route set is valid
* Fix case-insensitive search of location header [form#425](https://github.com/getgrav/grav-plugin-form/issues/425)
# v1.6.25
## 05/14/2020

View File

@@ -241,13 +241,15 @@ form:
type: commalist
pages.hide_empty_folders:
type: selectize
size: large
label: PLUGIN_ADMIN.HIDE_EMPTY_FOLDERS
help: PLUGIN_ADMIN.HIDE_EMPTY_FOLDERS_HELP
classes: fancy
validate:
type: commalist
type: toggle
label: PLUGIN_ADMIN.HIDE_EMPTY_FOLDERS
help: PLUGIN_ADMIN.HIDE_EMPTY_FOLDERS_HELP
highlight: 0
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool
pages.url_taxonomy_filters:
type: toggle
@@ -513,6 +515,16 @@ form:
validate:
type: bool
pages.markdown.valid_link_attributes:
type: selectize
size: large
label: PLUGIN_ADMIN.VALID_LINK_ATTRIBUTES
help: PLUGIN_ADMIN.VALID_LINK_ATTRIBUTES_HELP
placeholder: "rel, target, id, class, classes"
classes: fancy
validate:
type: commalist
caching:
type: tab
title: PLUGIN_ADMIN.CACHING

View File

@@ -59,6 +59,12 @@ pages:
special_chars: # List of special characters to automatically convert to entities
'>': 'gt'
'<': 'lt'
valid_link_attributes: # Valid attributes to pass through via markdown links
- rel
- target
- id
- class
- classes
types: [html,htm,xml,txt,json,rss,atom] # list of valid page types
append_url_extension: '' # Append page's extension in Page urls (e.g. '.html' results in /path/page.html)
expires: 604800 # Page expires time in seconds (604800 seconds = 7 days)

View File

@@ -8,7 +8,7 @@
// Some standard defines
define('GRAV', true);
define('GRAV_VERSION', '1.6.25');
define('GRAV_VERSION', '1.6.26');
define('GRAV_TESTING', false);
define('DS', '/');

View File

@@ -409,7 +409,7 @@ class Response
} else {
$code = (int)curl_getinfo($rch, CURLINFO_HTTP_CODE);
if ($code === 301 || $code === 302 || $code === 303) {
preg_match('/Location:(.*?)\n/', $header, $matches);
preg_match('/(?:^|\n)Location:(.*?)\n/i', $header, $matches);
$uri = trim(array_pop($matches));
} else {
$code = 0;

View File

@@ -87,7 +87,7 @@ class Excerpts
);
// Valid attributes supported.
$valid_attributes = ['rel', 'target', 'id', 'class', 'classes'];
$valid_attributes = Grav::instance()['config']->get('system.pages.markdown.valid_link_attributes');
// Unless told to not process, go through actions.
if (array_key_exists('noprocess', $actions)) {
@@ -232,6 +232,7 @@ class Excerpts
$url_parts = is_string($url) ? $this->parseUrl($url) : $url;
$actions = [];
// if there is a query, then parse it and build action calls
if (isset($url_parts['query'])) {
$actions = array_reduce(

View File

@@ -516,6 +516,15 @@ class ImageMedium extends Medium
return $this;
}
/**
* Handle this commonly used variant
*/
public function cropZoom()
{
$this->__call('zoomCrop', func_get_args());
return $this;
}
/**
* Forward the call to the image processing method.
*
@@ -525,10 +534,6 @@ class ImageMedium extends Medium
*/
public function __call($method, $args)
{
if ($method === 'cropZoom') {
$method = 'zoomCrop';
}
if (!\in_array($method, self::$magic_actions, true)) {
return parent::__call($method, $args);
}

View File

@@ -305,7 +305,7 @@ class Plugin implements EventSubscriberInterface, \ArrayAccess
// Create new config object and set it on the page object so it's cached for next time
$page->modifyHeader($class_name_merged, new Data($header));
} else if (isset($page_header->{$class_name_merged})) {
} elseif (isset($page_header->{$class_name_merged})) {
$merged = $page_header->{$class_name_merged};
$header = $merged->toArray();
}

View File

@@ -344,9 +344,8 @@ class Route
$parts[] = $this->language;
}
if ($this->route !== '') {
$parts[] = $this->extension ? $this->route . '.' . $this->extension : $this->route;
}
$parts[] = $this->extension ? $this->route . '.' . $this->extension : $this->route;
if ($this->gravParams) {
$parts[] = RouteFactory::buildParams($this->gravParams);