Skip to content

Commit

Permalink
Merge pull request #52 from hostep/fixes-php8-deprecated-functionality
Browse files Browse the repository at this point in the history
Fixes PHP 8.1 deprecated function calls with passing 'null' to 'trim'
  • Loading branch information
Mardl authored Nov 23, 2022
2 parents ae3c3ed + b7d64ac commit 6d6fee5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Plugin/Cms/Model/Block/BlockPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function beforeSave(
{
/** @noinspection PhpUndefinedMethodInspection */
$json = $block->getData(Constants::ATTR_PAGE_DESIGNER_JSON);
if (strlen(trim($json)) > 0) {
if (is_string($json) && strlen(trim($json)) > 0) {
$block->setContent($this->htmlRenderer->toHtml($json, $block->getData(Constants::ATTR_PAGE_DESIGNER_REMOVE)));
}
}
Expand Down
2 changes: 1 addition & 1 deletion Plugin/Cms/Model/Page/PagePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function beforeSave(
{
/** @noinspection PhpUndefinedMethodInspection */
$json = $page->getData(Constants::ATTR_PAGE_DESIGNER_JSON);
if (strlen(trim($json)) > 0) {
if (is_string($json) && strlen(trim($json)) > 0) {
$page->setContent($this->htmlRenderer->toHtml($json, $page->getData(Constants::ATTR_PAGE_DESIGNER_REMOVE)));
}
}
Expand Down

0 comments on commit 6d6fee5

Please sign in to comment.