Changeset 55994 for trunk/src/wp-includes/class-wpdb.php
- Timestamp:
- 06/23/2023 12:15:06 PM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wpdb.php
r55990 r55994 1497 1497 } 1498 1498 1499 // This is not meant to be foolproof -- but it will catch obviously incorrect usage. 1500 if ( ! str_contains( $query, '%' ) ) { 1499 /* 1500 * This is not meant to be foolproof -- but it will catch obviously incorrect usage. 1501 * 1502 * Note: str_contains() is not used here, as this file can be included 1503 * directly outside of WordPress core, e.g. by HyperDB, in which case 1504 * the polyfills from wp-includes/compat.php are not loaded. 1505 */ 1506 if ( false === strpos( $query, '%' ) ) { 1501 1507 wp_load_translations_early(); 1502 1508 _doing_it_wrong( … … 1565 1571 1566 1572 if ( 'f' === $type && true === $this->allow_unsafe_unquoted_parameters 1567 && str_ends_with( $split_query[ $key - 1 ], '%' ) 1573 /* 1574 * Note: str_ends_with() is not used here, as this file can be included 1575 * directly outside of WordPress core, e.g. by HyperDB, in which case 1576 * the polyfills from wp-includes/compat.php are not loaded. 1577 */ 1578 && '%' === substr( $split_query[ $key - 1 ], -1, 1 ) 1568 1579 ) { 1569 1580 … … 1626 1637 */ 1627 1638 if ( true !== $this->allow_unsafe_unquoted_parameters 1628 || ( '' === $format && ! str_ends_with( $split_query[ $key - 1 ], '%' ) ) 1639 /* 1640 * Note: str_ends_with() is not used here, as this file can be included 1641 * directly outside of WordPress core, e.g. by HyperDB, in which case 1642 * the polyfills from wp-includes/compat.php are not loaded. 1643 */ 1644 || ( '' === $format && '%' !== substr( $split_query[ $key - 1 ], -1, 1 ) ) 1629 1645 ) { 1630 1646 $placeholder = "'%" . $format . "s'"; … … 4039 4055 $db_server_info = $this->db_server_info(); 4040 4056 4041 // Account for MariaDB version being prefixed with '5.5.5-' on older PHP versions. 4042 if ( '5.5.5' === $db_version && str_contains( $db_server_info, 'MariaDB' ) 4057 /* 4058 * Account for MariaDB version being prefixed with '5.5.5-' on older PHP versions. 4059 * 4060 * Note: str_contains() is not used here, as this file can be included 4061 * directly outside of WordPress core, e.g. by HyperDB, in which case 4062 * the polyfills from wp-includes/compat.php are not loaded. 4063 */ 4064 if ( '5.5.5' === $db_version && false !== strpos( $db_server_info, 'MariaDB' ) 4043 4065 && PHP_VERSION_ID < 80016 // PHP 8.0.15 or older. 4044 4066 ) { … … 4068 4090 * libmysql has supported utf8mb4 since 5.5.3, same as the MySQL server. 4069 4091 * mysqlnd has supported utf8mb4 since 5.0.9. 4092 * 4093 * Note: str_contains() is not used here, as this file can be included 4094 * directly outside of WordPress core, e.g. by HyperDB, in which case 4095 * the polyfills from wp-includes/compat.php are not loaded. 4070 4096 */ 4071 if ( str_contains( $client_version, 'mysqlnd' ) ) {4097 if ( false !== strpos( $client_version, 'mysqlnd' ) ) { 4072 4098 $client_version = preg_replace( '/^\D+([\d.]+).*/', '$1', $client_version ); 4073 4099 return version_compare( $client_version, '5.0.9', '>=' );
Note: See TracChangeset
for help on using the changeset viewer.