Fixed fatal error if system.pages.types is not an array [#2984](https://github.com/getgrav/grav/issues/2984)

This commit is contained in:
Matias Griese
2021-04-09 14:45:05 +03:00
parent c5296cd7e0
commit 27dc8ffb45
2 changed files with 5 additions and 1 deletions

View File

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

View File

@@ -1844,11 +1844,14 @@ abstract class Utils
* 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']);