Skip to content

Commit

Permalink
Closes #3077: Address PHP 8.1+ deprecation warnings caused by card li…
Browse files Browse the repository at this point in the history
…nks with empty URLs. (#3078)

Closes #3077: Address deprecation caused by card links empty URLs.
  • Loading branch information
joeparsons authored Jan 12, 2024
1 parent 35d86c8 commit 5c38792
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
// Link.
$link_render_array = [];
if ($item->link_title || $item->link_uri) {
if (str_starts_with($item->link_uri, '/' . PublicStream::basePath())) {
if (str_starts_with($item->link_uri ?? '', '/' . PublicStream::basePath())) {
// Link to public file: use fromUri() to get the URL.
$link_url = Url::fromUri(urldecode('base:' . $item->link_uri));
}
Expand Down

0 comments on commit 5c38792

Please sign in to comment.