Skip to content

Make all JS files editable in the MODX manager in PHP 8.4 #16732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

halftrainedharry
Copy link
Contributor

What does it do?

Adds application/javascript to the list of non-binary MIME types.

Why is it needed?

In PHP 8.4 some *.js files return the MIME type application/javascript. The same files used to return text/plain in previous PHP versions.
(I believe finfo::file is used in the code to determine the MIME type, but I couldn't figure out what exactly changed in the new PHP version.)

How to test

  • Use PHP 8.4
  • Create a new JS file in the default file system, e.g. test.js
  • Enter the following content:
(function() {
	console.log('test');
}());
  • Make sure that this file is still editable in the MODX manager ("Files" tab).

Related issue(s)/PR(s)

Resolves #16730

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit javascript files via manager not working under PHP 8.4
1 participant