Fix deprecated function call on pathinfo

Created on 19 October 2022, over 1 year ago
Updated 10 April 2023, about 1 year ago

Problem/Motivation

When calling a non-existent image style url using PHP 8, you will get a deprecation warning:

Deprecated function: pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated in Drupal\imageapi_optimize_webp\Controller\ImageStyleDownloadController->deliver() (line 38 of .../modules/contrib/imageapi_optimize_webp/src/Controller/ImageStyleDownloadController.php)

Steps to reproduce

See above.

Proposed resolution

Add a check and throw a NotFoundHttpException exception according to the methods documentation, and core usage.

Remaining tasks

Patch.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands askibinski

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024