Changeset 2999:7a766509c5aa for inc/core/class.dc.core.php
- Timestamp:
- 04/22/15 11:57:45 (10 years ago)
- Branch:
- default
- committer:
- Nicolas <nikrou77@gmail.com> 1429696695 -7200
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.core.php
r2753 r2999 573 573 574 574 if (!empty($params['order']) && !$count_only) { 575 $strReq .= 'ORDER BY '.$this->con->escape($params['order']).' '; 575 if (preg_match('`^([^. ]+) (?:asc|desc)`i',$params['order'],$matches)) { 576 if (in_array($matches[1],array('user_id','user_name','user_firstname','user_displayname'))) { 577 $table_prefix = 'U'; 578 } else { 579 $table_prefix = 'P'; // order = nb_post (asc|desc) 580 } 581 $strReq .= 'ORDER BY '.$table_prefix.'.'.$this->con->escape($params['order']).' '; 582 } else { 583 $strReq .= 'ORDER BY '.$this->con->escape($params['order']).' '; 584 } 576 585 } else { 577 586 $strReq .= 'ORDER BY U.user_id ASC ';
Note: See TracChangeset
for help on using the changeset viewer.