[wp-trac] Re: [WordPress Trac] #8146: Quick tag/category edit appears to be using filtered data

WordPress Trac wp-trac at lists.automattic.com
Thu Nov 13 17:39:09 GMT 2008


#8146: Quick tag/category edit appears to be using filtered data
----------------------------------------------------+-----------------------
 Reporter:  jhodgdon                                |        Owner:  anonymous
     Type:  defect                                  |       Status:  reopened 
 Priority:  normal                                  |    Milestone:  2.7      
Component:  Administration                          |      Version:  2.7      
 Severity:  normal                                  |   Resolution:           
 Keywords:  tag, category, edit, filter, has-patch  |  
----------------------------------------------------+-----------------------
Changes (by jhodgdon):

  * keywords:  tag, category, edit, filter => tag, category, edit, filter,
               has-patch

Comment:

 I've created a patch that works for me...

 In my opinion, it's better to remove the cat_rows filters, as I've done in
 the patch, because if everything is properly filtered in the first place,
 they are unnecessary. But they were necessary in previous versions of WP,
 so a plugin that wants to be backwards compatible still needs to have them
 defined (or else do some complex version checking).

 As I mentioned above, a simpler patch that just display-filters $category
 directly does not work, because when you try to get the $qe_data, it ends
 up returning a reference to the same PHP object. That is why the patch
 instead just uses sanitize_term_field to sanitize the name and description
 fields, before displaying them, rather than sanitizing the entire object.
 And why the sanitized fields have to be stored in separate variables,
 rather than just replacing the ->name and ->description fields in the
 $category object. I did try it without separate variables, and $qe_data
 ended up sanitized for display.

 Anyway, there it is...

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8146#comment:22>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list