Changeset 54384 for trunk/src/wp-includes/class-wpdb.php
- Timestamp:
- 10/04/2022 03:39:28 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wpdb.php
r54240 r54384 3961 3961 */ 3962 3962 public function has_cap( $db_cap ) { 3963 $version = $this->db_version(); 3963 $db_version = $this->db_version(); 3964 $db_server_info = $this->db_server_info(); 3965 3966 // Account for MariaDB version being prefixed with '5.5.5-' on older PHP versions. 3967 if ( '5.5.5' === $db_version && str_contains( $db_server_info, 'MariaDB' ) 3968 && PHP_VERSION_ID < 80016 // PHP 8.0.15 or older. 3969 ) { 3970 // Strip the '5.5.5-' prefix and set the version to the correct value. 3971 $db_server_info = preg_replace( '/^5\.5\.5-(.*)/', '$1', $db_server_info ); 3972 $db_version = preg_replace( '/[^0-9.].*/', '', $db_server_info ); 3973 } 3964 3974 3965 3975 switch ( strtolower( $db_cap ) ) { … … 3967 3977 case 'group_concat': // @since 2.7.0 3968 3978 case 'subqueries': // @since 2.7.0 3969 return version_compare( $ version, '4.1', '>=' );3979 return version_compare( $db_version, '4.1', '>=' ); 3970 3980 case 'set_charset': 3971 return version_compare( $ version, '5.0.7', '>=' );3981 return version_compare( $db_version, '5.0.7', '>=' ); 3972 3982 case 'utf8mb4': // @since 4.1.0 3973 if ( version_compare( $ version, '5.5.3', '<' ) ) {3983 if ( version_compare( $db_version, '5.5.3', '<' ) ) { 3974 3984 return false; 3975 3985 } … … 3991 4001 } 3992 4002 case 'utf8mb4_520': // @since 4.6.0 3993 return version_compare( $ version, '5.6', '>=' );4003 return version_compare( $db_version, '5.6', '>=' ); 3994 4004 case 'identifier_placeholders': // @since 6.1.0 3995 4005 /*
Note: See TracChangeset
for help on using the changeset viewer.