[wp-trac] [WordPress Trac] #35588: $wpdb->db_version() wrongly documented
WordPress Trac
noreply at wordpress.org
Sat Jan 23 11:16:20 UTC 2016
#35588: $wpdb->db_version() wrongly documented
-------------------------+-----------------------------
Reporter: luciole135 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Database | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
The comment of db_version () function is false.
This function returns the version of MySQL, not the version of the
database as specified in the source files.
{{{#!php
<?php
/**
* The database version number.
*
* @since 2.7.0
*
* @return null|string Null on failure, version number on success.
*/
public function db_version() {
if ( $this->use_mysqli ) {
$server_info = mysqli_get_server_info( $this->dbh
);
} else {
$server_info = mysql_get_server_info( $this->dbh
);
}
return preg_replace( '/[^0-9.].*/', '', $server_info );
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35588>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list