Skip to content

Commit

Permalink
Merge branch 'release/1.7.30'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Feb 7, 2022
2 parents 9556e47 + b1938c9 commit 11013cb
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 57 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# v1.7.30
## 02/07/2022

1. [](#new)
* Added twig filter `|field_parent` to get parent field name
2. [](#bugfix)
* Fixed error while deleting retina image in admin
* Fixed "Page Authors" field in Security tab, wrongly loading and saving the value [#3525](https://github.com/getgrav/grav/issues/3525)
* Fixed accounts filter only matches against email address [getgrav/grav-plugin-admin#2224](https://github.com/getgrav/grav-plugin-admin/issues/2224)

# v1.7.29.1
## 01/31/2022

3. [](#bugfix)
1. [](#bugfix)
* Fixed `Call to undefined method` error when upgrading from Grav 1.6 [#3523](https://github.com/getgrav/grav/issues/3523)

# v1.7.29
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
"ext-intl": "Recommended for multi-language sites",
"ext-memcache": "Needed to support Memcache servers",
"ext-memcached": "Needed to support Memcached servers",
"ext-redis": "Needed to support Redis servers"
"ext-redis": "Needed to support Redis servers",
"ext-exif": "Needed to use exif data from images."
},
"config": {
"apcu-autoloader": true,
Expand Down
76 changes: 38 additions & 38 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions system/blueprints/flex/user-accounts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ config:
fields:
- key
- email
- username
- fullname

blueprints:
configure:
Expand Down
1 change: 1 addition & 0 deletions system/blueprints/flex/user-groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ config:
fields:
- key
- groupname
- readableName
- description

blueprints:
Expand Down
10 changes: 3 additions & 7 deletions system/blueprints/pages/partials/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,13 @@ form:
type: bool

header.permissions.authors:
type: list
type: array
toggleable: true
value_only: true
placeholder_value: PLUGIN_ADMIN.USERNAME
label: PLUGIN_ADMIN.PAGE_AUTHORS
help: PLUGIN_ADMIN.PAGE_AUTHORS_HELP

fields:
value:
type: text
placeholder: PLUGIN_ADMIN.USERNAME
style: vertical

header.permissions.groups:
ignore@: true
type: acl_picker
Expand Down
2 changes: 1 addition & 1 deletion system/defines.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

// Some standard defines
define('GRAV', true);
define('GRAV_VERSION', '1.7.29.1');
define('GRAV_VERSION', '1.7.30');
define('GRAV_SCHEMA', '1.7.0_2020-11-20_1');
define('GRAV_TESTING', false);

Expand Down
2 changes: 2 additions & 0 deletions system/src/Grav/Common/Media/Traits/MediaUploadTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,8 @@ protected function doRemove(string $filename, string $path): void
}
}
}

$this->hide($filename);
}

/**
Expand Down
18 changes: 9 additions & 9 deletions system/src/Grav/Common/Twig/Extension/FilesystemExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,24 +266,24 @@ public function getimagesize($filename)
}

/**
* @param string $file
* @param string $filename
* @param string|null $required_sections
* @param bool $as_arrays
* @param bool $read_thumbnail
* @return array|false
*/
public function exif_read_data($file, ?string $required_sections, bool $as_arrays = false, bool $read_thumbnail = false)
public function exif_read_data($filename, ?string $required_sections, bool $as_arrays = false, bool $read_thumbnail = false)
{
if (!Utils::functionExists('exif_read_data') || !$this->checkFilename($file)) {
if (!Utils::functionExists('exif_read_data') || !$this->checkFilename($filename)) {
return false;
}

return exif_read_data($file, $required_sections, $as_arrays, $read_thumbnail);
return exif_read_data($filename, $required_sections, $as_arrays, $read_thumbnail);
}

/**
* @param string $filename
* @return string|false
* @return int|false
*/
public function exif_imagetype($filename)
{
Expand Down Expand Up @@ -311,18 +311,18 @@ public function hash_file(string $algo, string $filename, bool $binary = false)

/**
* @param string $algo
* @param string $data
* @param string $filename
* @param string $key
* @param bool $binary
* @return string|false
*/
public function hash_hmac_file(string $algo, string $data, string $key, bool $binary = false)
public function hash_hmac_file(string $algo, string $filename, string $key, bool $binary = false)
{
if (!$this->checkFilename($data)) {
if (!$this->checkFilename($filename)) {
return false;
}

return hash_hmac_file($algo, $data, $key, $binary);
return hash_hmac_file($algo, $filename, $key, $binary);
}

/**
Expand Down
19 changes: 19 additions & 0 deletions system/src/Grav/Common/Twig/Extension/GravExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public function getFilters(): array
new TwigFilter('defined', [$this, 'definedDefaultFilter']),
new TwigFilter('ends_with', [$this, 'endsWithFilter']),
new TwigFilter('fieldName', [$this, 'fieldNameFilter']),
new TwigFilter('parent_field', [$this, 'fieldParentFilter']),
new TwigFilter('ksort', [$this, 'ksortFilter']),
new TwigFilter('ltrim', [$this, 'ltrimFilter']),
new TwigFilter('markdown', [$this, 'markdownFunction'], ['needs_context' => true, 'is_safe' => ['html']]),
Expand Down Expand Up @@ -260,6 +261,10 @@ public function getTokenParsers(): array
];
}

/**
* @param mixed $var
* @return string
*/
public function print_r($var)
{
return print_r($var, true);
Expand All @@ -278,6 +283,20 @@ public function fieldNameFilter($str)
return array_shift($path) . ($path ? '[' . implode('][', $path) . ']' : '');
}

/**
* Filters field name by changing dot notation into array notation.
*
* @param string $str
* @return string
*/
public function fieldParentFilter($str)
{
$path = explode('.', rtrim($str, '.'));
array_pop($path);

return implode('.', $path);
}

/**
* Protects email address.
*
Expand Down

0 comments on commit 11013cb

Please sign in to comment.