Skip to content

Commit

Permalink
[4.4] Fix strpos(): Passing null is deprecated (#42773)
Browse files Browse the repository at this point in the history
* Fix deprecated warning

* Better code.

Co-authored-by: Allon Moritz <allon.moritz@digital-peak.com>

---------

Co-authored-by: Quy <quy@fluxbb.org>
Co-authored-by: Allon Moritz <allon.moritz@digital-peak.com>
  • Loading branch information
3 people committed Feb 9, 2024
1 parent bef1c83 commit 0aba9c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/content/fields/src/Extension/Fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function onContentPrepare($context, &$item, &$params, $page = 0)
}

// Prepare the full text
if (property_exists($item, 'fulltext') && strpos($item->fulltext, 'field') !== false) {
if (!empty($item->fulltext) && strpos($item->fulltext, 'field') !== false) {
$item->fulltext = $this->prepare($item->fulltext, $context, $item);
}
}
Expand Down

0 comments on commit 0aba9c8

Please sign in to comment.