Remove extraneous function parameters in the wpdb class. props rlerdorf. see #24210.
git-svn-id: http://core.svn.wordpress.org/trunk@24121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a419c1810b
commit
e65c4190f1
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue