Skip to content

fix: normalize text/javascript mime type returned by PHP 8.6 - #6685

Merged
gharlan merged 1 commit into
5.xfrom
fix-js-mime-type-php86
Sep 22, 2026
Merged

gharlan merged 1 commit into
5.xfrom
fix-js-mime-type-php86

Conversation

@gharlan

@gharlan gharlan commented Sep 22, 2026

Copy link
Copy Markdown
Member

On PHP 8.6, mime_content_type() detects JavaScript files as text/javascript (RFC 9239) instead of application/javascript, which breaks FileTest::testMimeType in the PHP 8.6 CI job.

rex_file::mimeType() now maps text/javascript to application/javascript, so the result stays the same across PHP versions and matches the existing text/plain fallback for .js files. This also keeps existing allowed_mime_types configurations of the mediapool (e.g. js: ['application/javascript']) working after a PHP upgrade.

For 6.x it makes sense to switch the other way round to text/javascript.

@gharlan gharlan added this to the REDAXO 5.21.5 milestone Sep 22, 2026
@rex-bot rex-bot added the bug label Sep 22, 2026
@gharlan
gharlan merged commit 5ccac96 into 5.x Sep 22, 2026
18 checks passed
@gharlan
gharlan deleted the fix-js-mime-type-php86 branch September 22, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants