Skip to content

Commit

Permalink
fix: replace config(DocTypes::class) with new DocTypes()
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Aug 29, 2023
1 parent 1804bab commit 4570941
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion system/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
}

Expand Down
5 changes: 3 additions & 2 deletions system/Typography/Typography.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4570941

Please sign in to comment.