Skip to content

Commit

Permalink
Allow null input to convertLineEndings
Browse files Browse the repository at this point in the history
Sometimes the value of placeholders could be set to null when creating a new page.
  • Loading branch information
LukeTowers authored Nov 13, 2023
1 parent e8dbc3b commit c793c12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/ObjectHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ public static function resolveClassType(string $class): string
/**
* Converts line endings based on the system's configuration
*/
public static function convertLineEndings(string $markup): string
public static function convertLineEndings(?string $markup): string
{
if (Config::get('cms.convertLineEndings', false) === true) {
$markup = str_replace("\r\n", "\n", $markup);
$markup = str_replace("\r", "\n", $markup);
}

return $markup;
return $markup ?? '';
}

/**
Expand Down

0 comments on commit c793c12

Please sign in to comment.