mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Revert 23416, 23419, 23445 except for wp_reset_vars() changes. We are going a different direction with the slashing cleanup, so resetting to a clean slate. see #21767
git-svn-id: https://develop.svn.wordpress.org/trunk@23554 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -958,6 +958,8 @@ function get_term_by($field, $value, $taxonomy, $output = OBJECT, $filter = 'raw
|
||||
if ( empty($value) )
|
||||
return false;
|
||||
} else if ( 'name' == $field ) {
|
||||
// Assume already escaped
|
||||
$value = stripslashes($value);
|
||||
$field = 't.name';
|
||||
} else {
|
||||
$term = get_term( (int) $value, $taxonomy, $output, $filter);
|
||||
@@ -1497,7 +1499,7 @@ function term_exists($term, $taxonomy = '', $parent = 0) {
|
||||
return $wpdb->get_var( $wpdb->prepare( $select . $where, $term ) );
|
||||
}
|
||||
|
||||
$term = trim( $term );
|
||||
$term = trim( stripslashes( $term ) );
|
||||
|
||||
if ( '' === $slug = sanitize_title($term) )
|
||||
return 0;
|
||||
@@ -2059,6 +2061,10 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
|
||||
$args = sanitize_term($args, $taxonomy, 'db');
|
||||
extract($args, EXTR_SKIP);
|
||||
|
||||
// expected_slashed ($name)
|
||||
$name = stripslashes($name);
|
||||
$description = stripslashes($description);
|
||||
|
||||
if ( empty($slug) )
|
||||
$slug = sanitize_title($name);
|
||||
|
||||
@@ -2438,6 +2444,9 @@ function wp_update_term( $term_id, $taxonomy, $args = array() ) {
|
||||
if ( is_wp_error( $term ) )
|
||||
return $term;
|
||||
|
||||
// Escape data pulled from DB.
|
||||
$term = add_magic_quotes($term);
|
||||
|
||||
// Merge old and new args with new args overwriting old ones.
|
||||
$args = array_merge($term, $args);
|
||||
|
||||
@@ -2446,6 +2455,10 @@ function wp_update_term( $term_id, $taxonomy, $args = array() ) {
|
||||
$args = sanitize_term($args, $taxonomy, 'db');
|
||||
extract($args, EXTR_SKIP);
|
||||
|
||||
// expected_slashed ($name)
|
||||
$name = stripslashes($name);
|
||||
$description = stripslashes($description);
|
||||
|
||||
if ( '' == trim($name) )
|
||||
return new WP_Error('empty_term_name', __('A name is required for this term'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user