diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 14e765a882..739ec23787 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -640,13 +640,13 @@ class wpdb { * @param string $charset The character set (optional) * @param string $collate The collation (optional) */ - function set_charset($dbh, $charset = null, $collate = null) { - if ( !isset($charset) ) + function set_charset( $dbh, $charset = null, $collate = null ) { + if ( ! isset( $charset ) ) $charset = $this->charset; - if ( !isset($collate) ) + if ( ! isset( $collate ) ) $collate = $this->collate; - if ( $this->has_cap( 'collation', $dbh ) && !empty( $charset ) ) { - if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset', $dbh ) ) { + if ( $this->has_cap( 'collation' ) && ! empty( $charset ) ) { + if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset' ) ) { mysql_set_charset( $charset, $dbh ); $this->real_escape = true; } else { @@ -1687,12 +1687,12 @@ class wpdb { } /** - * Determine if a database supports a particular feature + * Determine if a database supports a particular feature. * * @since 2.7.0 - * @see wpdb::db_version() + * @see wpdb::db_version() * - * @param string $db_cap the feature + * @param string $db_cap The feature to check for. * @return bool */ function has_cap( $db_cap ) { @@ -1700,11 +1700,11 @@ class wpdb { switch ( strtolower( $db_cap ) ) { case 'collation' : // @since 2.5.0 - case 'group_concat' : // @since 2.7 - case 'subqueries' : // @since 2.7 + case 'group_concat' : // @since 2.7.0 + case 'subqueries' : // @since 2.7.0 return version_compare( $version, '4.1', '>=' ); case 'set_charset' : - return version_compare($version, '5.0.7', '>='); + return version_compare( $version, '5.0.7', '>=' ); }; return false;