Skip to content

Commit

Permalink
Fixed fatal error if system.pages.types is not an array [#2984](#2984)
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Apr 9, 2021
1 parent c5296cd commit 27dc8ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Fixed deleting page with language code not removing the folder if it was the last language [#3305](https://github.com/getgrav/grav/issues/3305)
* Fixed fatal error when using markdown links with `image://` stream [#3285](https://github.com/getgrav/grav/issues/3285)
* Fixed `system.languages.session_store_active` not having any effect [#3269](https://github.com/getgrav/grav/issues/3269)
* Fixed fatal error if `system.pages.types` is not an array [#2984](https://github.com/getgrav/grav/issues/2984)

# v1.7.10
## 04/06/2021
Expand Down
5 changes: 4 additions & 1 deletion system/src/Grav/Common/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -1844,11 +1844,14 @@ public static function getSubnet($ip, $prefix = 64)
* Wrapper to ensure html, htm in the front of the supported page types
*
* @param array|null $defaults
* @return array|mixed
* @return array
*/
public static function getSupportPageTypes(array $defaults = null)
{
$types = Grav::instance()['config']->get('system.pages.types', $defaults);
if (!is_array($types)) {
return [];
}

// remove html/htm
$types = static::arrayRemoveValue($types, ['html', 'htm']);
Expand Down

0 comments on commit 27dc8ff

Please sign in to comment.