Ticket #9505: 9505.diff
| File 9505.diff, 2.0 KB (added by , 17 years ago) |
|---|
-
wp-includes/wp-db.php
697 697 * 698 698 * @since 2.5.0 699 699 * 700 * @param string $table WARNING: not sanitized!700 * @param string $table table name 701 701 * @param array $data Should not already be SQL-escaped 702 702 * @param array|string $format The format of the field values. 703 703 * @return mixed Results of $this->query() … … 717 717 $form = '%s'; 718 718 $formatted_fields[] = $form; 719 719 } 720 $sql = "INSERT INTO $table(`" . implode( '`,`', $fields ) . "`) VALUES ('" . implode( "','", $formatted_fields ) . "')";720 $sql = "INSERT INTO `$table` (`" . implode( '`,`', $fields ) . "`) VALUES ('" . implode( "','", $formatted_fields ) . "')"; 721 721 return $this->query( $this->prepare( $sql, $data) ); 722 722 } 723 723 … … 726 726 * 727 727 * @since 2.5.0 728 728 * 729 * @param string $table WARNING: not sanitized!729 * @param string $table table name 730 730 * @param array $data Should not already be SQL-escaped 731 * @param array $where A named array of WHERE column => value relationships. Multiple member pairs will be joined with ANDs. WARNING: the column names are not currently sanitized!731 * @param array $where A named array of WHERE column => value relationships. Multiple member pairs will be joined with ANDs. 732 732 * @param array|string $format The format of the field values. 733 733 * @param array|string $where_format The format of the where field values. 734 734 * @return mixed Results of $this->query() … … 759 759 $form = $db_field_types[$field]; 760 760 else 761 761 $form = '%s'; 762 $wheres[] = " $field= {$form}";762 $wheres[] = "`$field` = {$form}"; 763 763 } 764 764 765 $sql = "UPDATE $tableSET " . implode( ', ', $bits ) . ' WHERE ' . implode( ' AND ', $wheres );765 $sql = "UPDATE `$table` SET " . implode( ', ', $bits ) . ' WHERE ' . implode( ' AND ', $wheres ); 766 766 return $this->query( $this->prepare( $sql, array_merge(array_values($data), array_values($where))) ); 767 767 } 768 768
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)