HDInnovations / UNIT3D-Community-Edition

Private Torrent Tracker Built With Laravel, Livewire and AlpineJS.
GNU Affero General Public License v3.0
1.97k stars 378 forks source link

[Bug] strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated #4284

Closed HDVinnie closed 4 days ago

HDVinnie commented 5 days ago

UNIT3D Version

v8.3.3

PHP & Platform

8.3.12

Laravel verion

11.29.0

Have you done this?

Expectation

No deprecations in log.

Description

resources/views/components/torrent/card.blade.php

        <p class="torrent-card__plot">
            {{ Str::limit(strip_tags($meta?->overview ?: $meta?->summary), 350, '...') }}
        </p>

Stack trace & logs

strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/storage/framework/views/bb35d48a9669f8523afe2b09a6b1d90b.php on line 141

Upvote & Fund

Fund with Polar

Roardom commented 5 days ago

The following laravel function casts null to an empty string first:

https://laravel.com/docs/11.x/strings#method-fluent-str-strip-tags