WordPress.org

Make WordPress Core

Changeset 33455


Ignore:
Timestamp:
07/28/2015 06:31:39 AM (5 years ago)
Author:
pento
Message:

WPDB: When checking the encoding of strings against the database, make sure we're only relying on the return value of strings that were sent to the database. Also make sure that we're not trying to sanity check strings that've been marked as not needing sanity checking.

Fixes #32279.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/wp-db.php

    r33310 r33455  
    21132113        $this->func_call = "\$db->get_var(\"$query\", $x, $y)";
    21142114
    2115         if ( $this->check_safe_collation( $query ) ) {
     2115        if ( $this->check_current_query && $this->check_safe_collation( $query ) ) {
    21162116            $this->check_current_query = false;
    21172117        }
     
    21482148        $this->func_call = "\$db->get_row(\"$query\",$output,$y)";
    21492149
    2150         if ( $this->check_safe_collation( $query ) ) {
     2150        if ( $this->check_current_query && $this->check_safe_collation( $query ) ) {
    21512151            $this->check_current_query = false;
    21522152        }
     
    21892189     */
    21902190    public function get_col( $query = null , $x = 0 ) {
    2191         if ( $this->check_safe_collation( $query ) ) {
     2191        if ( $this->check_current_query && $this->check_safe_collation( $query ) ) {
    21922192            $this->check_current_query = false;
    21932193        }
     
    22232223        $this->func_call = "\$db->get_results(\"$query\", $output)";
    22242224
    2225         if ( $this->check_safe_collation( $query ) ) {
     2225        if ( $this->check_current_query && $this->check_safe_collation( $query ) ) {
    22262226            $this->check_current_query = false;
    22272227        }
     
    27492749
    27502750            foreach ( array_keys( $data ) as $column ) {
    2751                 $data[ $column ]['value'] = $row["x_$column"];
     2751                if ( isset( $row["x_$column"] ) ) {
     2752                    $data[ $column ]['value'] = $row["x_$column"];
     2753                }
    27522754            }
    27532755        }
Note: See TracChangeset for help on using the changeset viewer.