diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php
index 6a8893a..0e50fbb 100644
a
|
b
|
class wpdb { |
808 | 808 | * @since 3.9.0 |
809 | 809 | * |
810 | 810 | * @param array $modes Optional. A list of SQL modes to set. |
| 811 | * @param resource|null $dbh Optional link identifier. |
811 | 812 | */ |
812 | | public function set_sql_mode( $modes = array() ) { |
| 813 | public function set_sql_mode( $modes = array(), $dbh = null ) { |
| 814 | if ( is_null( $dbh ) ) { |
| 815 | $dbh = $this->dbh; |
| 816 | } |
| 817 | |
813 | 818 | if ( empty( $modes ) ) { |
814 | 819 | if ( $this->use_mysqli ) { |
815 | | $res = mysqli_query( $this->dbh, 'SELECT @@SESSION.sql_mode' ); |
| 820 | $res = mysqli_query( $dbh, 'SELECT @@SESSION.sql_mode' ); |
816 | 821 | } else { |
817 | | $res = mysql_query( 'SELECT @@SESSION.sql_mode', $this->dbh ); |
| 822 | $res = mysql_query( 'SELECT @@SESSION.sql_mode', $dbh ); |
818 | 823 | } |
819 | 824 | |
820 | 825 | if ( empty( $res ) ) { |
… |
… |
class wpdb { |
858 | 863 | $modes_str = implode( ',', $modes ); |
859 | 864 | |
860 | 865 | if ( $this->use_mysqli ) { |
861 | | mysqli_query( $this->dbh, "SET SESSION sql_mode='$modes_str'" ); |
| 866 | mysqli_query( $dbh, "SET SESSION sql_mode='$modes_str'" ); |
862 | 867 | } else { |
863 | | mysql_query( "SET SESSION sql_mode='$modes_str'", $this->dbh ); |
| 868 | mysql_query( "SET SESSION sql_mode='$modes_str'", $dbh ); |
864 | 869 | } |
865 | 870 | } |
866 | 871 | |
… |
… |
class wpdb { |
1556 | 1561 | $this->set_charset( $this->dbh ); |
1557 | 1562 | |
1558 | 1563 | $this->ready = true; |
1559 | | $this->set_sql_mode(); |
| 1564 | $this->set_sql_mode( array(), $this->dbh ); |
1560 | 1565 | $this->select( $this->dbname, $this->dbh ); |
1561 | 1566 | |
1562 | 1567 | return true; |