Dotclear

Changeset 3077:cf08ef81780e


Ignore:
Timestamp:
08/17/15 15:47:11 (10 years ago)
Author:
Dsls
Branch:
2.8
Children:
3078:2980b7408547, 3079:7701177797c7
Message:

nb_post has no table prefix when querying users, fixes #2127

File:
1 edited

Legend:

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

    r3064 r3077  
    574574                    if (preg_match('`^([^. ]+) (?:asc|desc)`i',$params['order'],$matches)) { 
    575575                         if (in_array($matches[1],array('user_id','user_name','user_firstname','user_displayname'))) { 
    576                               $table_prefix = 'U'; 
     576                              $table_prefix = 'U.'; 
    577577                         } else { 
    578                               $table_prefix = 'P'; // order = nb_post (asc|desc) 
     578                              $table_prefix = ''; // order = nb_post (asc|desc) 
    579579                         } 
    580                          $strReq .= 'ORDER BY '.$table_prefix.'.'.$this->con->escape($params['order']).' '; 
     580                         $strReq .= 'ORDER BY '.$table_prefix.$this->con->escape($params['order']).' '; 
    581581                    } else { 
    582582                         $strReq .= 'ORDER BY '.$this->con->escape($params['order']).' '; 
     
    590590               $strReq .= $this->con->limit($params['limit']); 
    591591          } 
    592  
    593592          $rs = $this->con->select($strReq); 
    594593          $rs->extend('rsExtUser'); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map