fruitcake / laravel-telescope-toolbar

A toolbar for Laravel Telescope, based on the Symfony Web Profiler.
MIT License
778 stars 39 forks source link

stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated #64

Closed LocalHeroPro closed 1 year ago

LocalHeroPro commented 2 years ago

Laravel deprecation warning:

storage/logs/php-deprecation-warnings.log:84:[2022-10-16 14:53:13] local.WARNING: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/vendor/fruitcake/laravel-telescope-toolbar/src/Toolbar.php on line 93

on:

    /**
     * @param \Illuminate\Http\Request $request A Request instance
     * @param \Symfony\Component\HttpFoundation\Response $response A Response instance
     */
    public function modifyResponse($request, $response)
    {
        //
        // Skip non-html requests
        if (($response->headers->has('Content-Type') && strpos($response->headers->get('Content-Type'), 'html') === false)
            || $request->getRequestFormat() !== 'html'
            || stripos($response->headers->get('Content-Disposition'), 'attachment;') !== false
        ) {
            return;
        }
        //
    }