From 5a7ecd47c0a9d2fb241296e0df08c7fc29f89912 Mon Sep 17 00:00:00 2001 From: bricebou Date: Sat, 6 Aug 2022 22:21:54 +0200 Subject: [PATCH] Fix #2 : warning on line 153 when no language is configured at all in the System > Languages settings --- better-typography.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/better-typography.php b/better-typography.php index 1be4916..feacda9 100644 --- a/better-typography.php +++ b/better-typography.php @@ -142,6 +142,9 @@ public function betterTypo(string $string, string $language = null): string if (!$language) { $language = $this->grav['page']->language() ?? $this->grav['language']->getLanguage(); + if (!$language) { + $language = $this->grav['config']->get('site.default_lang'); + } } $betterTypoSettings = [];