Cockpit-HQ / Cockpit

Cockpit Core - Content Platform
https://getcockpit.com
Other
388 stars 47 forks source link

Regression: If mime is not defined for asset, PHP 8.1 will issue deprecation issue #177

Closed KIDS-interactive closed 8 months ago

KIDS-interactive commented 8 months ago

If we use the assets API endpoint, we get the following deprecation message:

Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /modules/Assets/Helper/Asset.php on line 201

The reason is this commit: https://github.com/Cockpit-HQ/Cockpit/commit/474bce9500e69feb5a089c96166eaaaa98f83185

You should not assume the existence of the variable $mime here!

aheinze commented 8 months ago

Thank you for reporting. The fix will be available in the next release