]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/wp-db.php
WordPress 4.2.4
[autoinstalls/wordpress.git] / wp-includes / wp-db.php
index d0a5a29ab02df2142006adf6e89768b3e6e1016e..14a3438b8edaac6305bb4737981e9bb65e316127 100644 (file)
@@ -2081,7 +2081,7 @@ class wpdb {
        public function get_var( $query = null, $x = 0, $y = 0 ) {
                $this->func_call = "\$db->get_var(\"$query\", $x, $y)";
 
-               if ( $this->check_safe_collation( $query ) ) {
+               if ( $this->check_current_query && $this->check_safe_collation( $query ) ) {
                        $this->check_current_query = false;
                }
 
@@ -2114,7 +2114,7 @@ class wpdb {
        public function get_row( $query = null, $output = OBJECT, $y = 0 ) {
                $this->func_call = "\$db->get_row(\"$query\",$output,$y)";
 
-               if ( $this->check_safe_collation( $query ) ) {
+               if ( $this->check_current_query && $this->check_safe_collation( $query ) ) {
                        $this->check_current_query = false;
                }
 
@@ -2155,7 +2155,7 @@ class wpdb {
         * @return array Database query result. Array indexed from 0 by SQL result row number.
         */
        public function get_col( $query = null , $x = 0 ) {
-               if ( $this->check_safe_collation( $query ) ) {
+               if ( $this->check_current_query && $this->check_safe_collation( $query ) ) {
                        $this->check_current_query = false;
                }
 
@@ -2187,7 +2187,7 @@ class wpdb {
        public function get_results( $query = null, $output = OBJECT ) {
                $this->func_call = "\$db->get_results(\"$query\", $output)";
 
-               if ( $this->check_safe_collation( $query ) ) {
+               if ( $this->check_current_query && $this->check_safe_collation( $query ) ) {
                        $this->check_current_query = false;
                }
 
@@ -2713,7 +2713,9 @@ class wpdb {
                        }
 
                        foreach ( array_keys( $data ) as $column ) {
-                               $data[ $column ]['value'] = $row["x_$column"];
+                               if ( isset( $row["x_$column"] ) ) {
+                                       $data[ $column ]['value'] = $row["x_$column"];
+                               }
                        }
                }