From facdb7e8867625053bab43790cffb27b037bb272 Mon Sep 17 00:00:00 2001
From: Paul Biron <paul@sparrowhawkcomputing.com>
Date: Tue, 19 Jul 2022 16:57:27 -0600
Subject: [PATCH] Same as 48116.5 except that: 1) it sorts the PHP extenions in
case-insensitive manner, and 2) fixes a few WPCS problems.
---
src/wp-includes/update.php | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/src/wp-includes/update.php b/src/wp-includes/update.php
index 04c8aa3ec2..bc295359bf 100644
|
a
|
b
|
function wp_version_check( $extra_stats = array(), $force_check = false ) { |
| 89 | 89 | $wp_install = home_url( '/' ); |
| 90 | 90 | } |
| 91 | 91 | |
| | 92 | $extensions = get_loaded_extensions(); |
| | 93 | sort( $extensions, SORT_STRING | SORT_FLAG_CASE ); |
| 92 | 94 | $query = array( |
| 93 | 95 | 'version' => $wp_version, |
| 94 | 96 | 'php' => $php_version, |
| … |
… |
function wp_version_check( $extra_stats = array(), $force_check = false ) { |
| 99 | 101 | 'users' => get_user_count(), |
| 100 | 102 | 'multisite_enabled' => $multisite_enabled, |
| 101 | 103 | 'initial_db_version' => get_site_option( 'initial_db_version' ), |
| | 104 | 'extensions' => array_combine( $extensions, array_map( 'phpversion', $extensions ) ), |
| | 105 | 'platform_flags' => array( |
| | 106 | 'os' => PHP_OS, |
| | 107 | 'bits' => PHP_INT_SIZE === 4 ? 32 : 64, |
| | 108 | ), |
| | 109 | 'image_support' => array(), |
| 102 | 110 | ); |
| 103 | 111 | |
| | 112 | if ( function_exists( 'gd_info' ) ) { |
| | 113 | $gd_info = gd_info(); |
| | 114 | // Filter to supported values. |
| | 115 | $gd_info = array_filter( $gd_info ); |
| | 116 | |
| | 117 | // Add data for GD WebP and AVIF support. |
| | 118 | $query['image_support']['gd'] = array_keys( |
| | 119 | array_filter( |
| | 120 | array( |
| | 121 | 'webp' => isset( $gd_info['WebP Support'] ), |
| | 122 | 'avif' => isset( $gd_info['AVIF Support'] ), |
| | 123 | ) |
| | 124 | ) |
| | 125 | ); |
| | 126 | } |
| | 127 | |
| | 128 | if ( class_exists( 'Imagick' ) ) { |
| | 129 | // Add data for Imagick WebP and AVIF support. |
| | 130 | $query['image_support']['imagick'] = array_keys( |
| | 131 | array_filter( |
| | 132 | array( |
| | 133 | 'webp' => ! empty( Imagick::queryFormats( 'WEBP' ) ), |
| | 134 | 'avif' => ! empty( Imagick::queryFormats( 'AVIF' ) ), |
| | 135 | ) |
| | 136 | ) |
| | 137 | ); |
| | 138 | } |
| | 139 | |
| 104 | 140 | /** |
| 105 | 141 | * Filters the query arguments sent as part of the core version check. |
| 106 | 142 | * |