WordPress 7.1.3

This commit is contained in:
2026-10-06 18:59:45 -06:00
parent e2c26b7f21
commit 5c09d6fa68
51 changed files with 1111 additions and 825 deletions
@@ -830,10 +830,12 @@ trait WordPress {
* @return array
*/
public static function filetype_and_ext( $types, $file, $filename ) {
if ( false !== strpos( $filename, '.json' ) ) {
// Validate the real trailing extension so names like `file.json.php` are rejected.
$extension = strtolower( pathinfo( $filename, PATHINFO_EXTENSION ) );
if ( 'json' === $extension ) {
$types['ext'] = 'json';
$types['type'] = 'application/json';
} elseif ( false !== strpos( $filename, '.txt' ) ) {
} elseif ( 'txt' === $extension ) {
$types['ext'] = 'txt';
$types['type'] = 'text/plain';
}