Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#35588 closed enhancement (fixed)

$wpdb->db_version() wrongly documented

Reported by: luciole135's profile luciole135 Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.5 Priority: normal
Severity: normal Version: 2.7
Component: Database Keywords:
Focuses: Cc:

Description

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
/**
         * 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 );
        }

Attachments (1)

ticket#.patch (344 bytes) - added by luciole135 9 years ago.

Download all attachments as: .zip

Change History (4)

@luciole135
9 years ago

#1 @SergeyBiryukov
9 years ago

  • Milestone changed from Awaiting Review to 4.5

#2 @SergeyBiryukov
9 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 36385:

Docs: Correct wpdb::db_version() description.

Props luciole135.
Fixes #35588.

#3 @johnbillion
9 years ago

  • Version changed from trunk to 2.7
Note: See TracTickets for help on using tickets.