Changeset 59803 for trunk/src/wp-admin/includes/update-core.php
- Timestamp:
- 02/11/2025 11:12:03 AM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/update-core.php
r59386 r59803 1010 1010 * @global array $_new_bundled_files 1011 1011 * @global wpdb $wpdb WordPress database abstraction object. 1012 * @global string $wp_version1013 * @global string $required_php_version1014 * @global string $required_mysql_version1015 1012 * 1016 1013 * @param string $from New release unzipped path. … … 1076 1073 1077 1074 /* 1078 * Import $wp_version, $required_php_version, and $required_mysql_version from the new version.1075 * Import $wp_version, $required_php_version, $required_php_extensions, and $required_mysql_version from the new version. 1079 1076 * DO NOT globalize any variables imported from `version-current.php` in this function. 1080 1077 * … … 1182 1179 } 1183 1180 1184 // Add a warning when the JSON PHP extension is missing. 1185 if ( ! extension_loaded( 'json' ) ) { 1186 return new WP_Error( 1187 'php_not_compatible_json', 1188 sprintf( 1189 /* translators: 1: WordPress version number, 2: The PHP extension name needed. */ 1190 __( 'The update cannot be installed because WordPress %1$s requires the %2$s PHP extension.' ), 1191 $wp_version, 1192 'JSON' 1193 ) 1194 ); 1181 if ( isset( $required_php_extensions ) && is_array( $required_php_extensions ) ) { 1182 $missing_extensions = new WP_Error(); 1183 1184 foreach ( $required_php_extensions as $extension ) { 1185 if ( extension_loaded( $extension ) ) { 1186 continue; 1187 } 1188 1189 $missing_extensions->add( 1190 "php_not_compatible_{$extension}", 1191 sprintf( 1192 /* translators: 1: WordPress version number, 2: The PHP extension name needed. */ 1193 __( 'The update cannot be installed because WordPress %1$s requires the %2$s PHP extension.' ), 1194 $wp_version, 1195 $extension 1196 ) 1197 ); 1198 } 1199 1200 // Add a warning when required PHP extensions are missing. 1201 if ( $missing_extensions->has_errors() ) { 1202 return $missing_extensions; 1203 } 1195 1204 } 1196 1205
Note: See TracChangeset
for help on using the changeset viewer.