Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#35588 closed enhancement (fixed)

$wpdb->db_version() wrongly documented

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

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 11 years ago.

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review → 4.5

#2 @SergeyBiryukov
11 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 36385:

Docs: Correct wpdb::db_version() description.

Props luciole135.
Fixes #35588.

#3 @johnbillion
11 years ago

  • Version trunk → 2.7
Note: See TracTickets for help on using tickets.