Open e46lux opened 9 months ago
PHP's json_decode()
automatically converts those particular entries to integers internally when using them as keys for the target array (despite being quoted).
Unfortunately, since it happens internally (and when the keys are established), it's not a simple matter of casting ourselves before use. 🤔
⚠️ This issue respects the following points: ⚠️
Bug description
Setting mimetypemapping.json to the following:
breaks mime type loader with an error:
TypeError: str_starts_with(): Argument #1 ($haystack) must be of type string, int given in /var/www/nextcloud/lib/private/Files/Type/Detection.php:119
As soon as you remove the rows "0" through "9" it works fine. Would be nice to view filenames that end in a number in the text viewer for browsing nginx logs for example. Cheers~
Steps to reproduce
Expected behavior
Would like the ".0" file to open in text editor.
Installation method
Community Web installer on a VPS or web space
Nextcloud Server version
28
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response