WordPress.org

Make WordPress Core

Ticket #10966: category.php.diff

File category.php.diff, 1.4 KB (added by dwright, 9 years ago)

wp-includes/category.php.patch file

  • wp-includes/category.php

     
    351351                $category->cat_ID = &$category->term_id;
    352352                $category->category_count = &$category->count;
    353353                $category->category_description = &$category->description;
    354                 $category->cat_name = &$category->name;
    355                 $category->category_nicename = &$category->slug;
     354                $category->cat_name = esc_attr(&$category->name);
     355                $category->category_nicename = esc_attr(apply_filters('editable_slug',&$category->slug));
     356                $category->slug = esc_attr(apply_filters('editable_slug',&$category->slug));
    356357                $category->category_parent = &$category->parent;
    357358        } elseif ( is_array( $category ) && isset( $category['term_id'] ) ) {
    358359                $category['cat_ID'] = &$category['term_id'];
    359360                $category['category_count'] = &$category['count'];
    360361                $category['category_description'] = &$category['description'];
    361                 $category['cat_name'] = &$category['name'];
    362                 $category['category_nicename'] = &$category['slug'];
     362                $category['cat_name'] = esc_attr(apply_filters('editable_slug',&$category['name']));
     363                $category['category_nicename'] = esc_attr(apply_filters('editable_slug',&$category['slug']));
     364                $category['slug'] = esc_attr(&$category['slug']);
    363365                $category['category_parent'] = &$category['parent'];
    364366        }
    365367}