From 45709418db8067b699fbe93a058b72c2e9c27e22 Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 29 Aug 2023 10:01:05 +0900 Subject: [PATCH] fix: replace `config(DocTypes::class)` with `new DocTypes()` --- system/Common.php | 3 ++- system/Typography/Typography.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/system/Common.php b/system/Common.php index ff9ca929c9f9..03f72640e92e 100644 --- a/system/Common.php +++ b/system/Common.php @@ -890,7 +890,8 @@ function redirect(?string $route = null): RedirectResponse */ function _solidus(): string { - if (config(DocTypes::class)->html5 ?? false) { + $docTypes = new DocTypes(); + if ($docTypes->html5 ?? false) { return ''; } diff --git a/system/Typography/Typography.php b/system/Typography/Typography.php index 1ca7a56ff598..fb05b68faefe 100644 --- a/system/Typography/Typography.php +++ b/system/Typography/Typography.php @@ -323,10 +323,11 @@ protected function protectCharacters(array $match): string */ public function nl2brExceptPre(string $str): string { - $newstr = ''; + $newstr = ''; + $docTypes = new DocTypes(); for ($ex = explode('pre>', $str), $ct = count($ex), $i = 0; $i < $ct; $i++) { - $xhtml = ! (config(DocTypes::class)->html5 ?? false); + $xhtml = ! ($docTypes->html5 ?? false); $newstr .= (($i % 2) === 0) ? nl2br($ex[$i], $xhtml) : $ex[$i]; if ($ct - 1 !== $i) {