[wp-trac] Re: [WordPress Trac] #3723: Tagging
WordPress Trac
wp-trac at lists.automattic.com
Thu Feb 1 01:28:53 GMT 2007
#3723: Tagging
-------------------------+--------------------------------------------------
Reporter: ryan | Owner: ryan
Type: enhancement | Status: new
Priority: normal | Milestone: 2.2
Component: General | Version: 2.1
Severity: normal | Resolution:
Keywords: tags |
-------------------------+--------------------------------------------------
Comment (by nbachiyski):
Just some trivial notes on the code in the patch:
* On line 31 in {{{tag.php}}} the {{{$tag}}} variable should be escaped
before being used in the query (I know it is sanitized before
{{{INSERT}}}, but who knows...);
* The insertions and deletions of post tags in {{{wp_set_post_tags}}}
could be done with just one query each, not lots of queries in a loop;
* The count update could be done with 2 queries - one for the added ones,
which increments their count with 1, and one for the deleted ones, which
decrements their count with 1. Thus we will also get rid of the
{{{COUNT(*)}}} calls;
* We need a unique key on {{{raw_tag}}} in the {{{$wpdb->tags}}} table,
because of the query in {{{get_tag_id()}}}.
--
Ticket URL: <http://trac.wordpress.org/ticket/3723#comment:14>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list