Dotclear

Changeset 1110:44e8d66c9012


Ignore:
Timestamp:
03/08/13 11:32:08 (13 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
2.5
Message:

Avoid unnecessary statement in SQL query (see  http://forum.dotclear.org/viewtopic.php?pid=320290)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.blog.php

    r1052 r1110  
    228228               'SELECT post_id, COUNT(post_id) AS nb_comment,comment_trackback '. 
    229229               'FROM '.$this->prefix.'comment '. 
    230                'WHERE post_id'.$this->con->in($a_ids). 
    231                'AND comment_status = 1 '; 
     230               'WHERE comment_status = 1 '. 
     231               (count($a_ids) > 0 ? 'AND post_id'.$this->con->in($a_ids) : ''); 
    232232           
    233233          if ($del) { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map