Skip to content

Commit

Permalink
adding escape to order_by
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaabi authored May 18, 2017
1 parent 58495ef commit 12ec257
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions application/libraries/Grocery_CRUD.php
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ protected function db_relation_n_n_delete($field_info, $primary_key_value)
protected function get_list()
{
if(!empty($this->order_by))
$this->basic_model->order_by($this->order_by[0],$this->order_by[1]);
$this->basic_model->order_by($this->order_by[0], $this->order_by[1], $this->order_by[2]);

if(!empty($this->where))
foreach($this->where as $where)
Expand Down Expand Up @@ -4331,13 +4331,12 @@ protected function get_read_fields()
return $this->read_fields;
}

public function order_by($order_by, $direction = 'asc')
{
$this->order_by = array($order_by,$direction);

return $this;
}
public function order_by($order_by, $direction = 'asc', $escape = NULL)
{
$this->order_by = array($order_by, $direction, $escape);

return $this;
}
public function where($key, $value = NULL, $escape = TRUE)
{
$this->where[] = array($key,$value,$escape);
Expand Down

0 comments on commit 12ec257

Please sign in to comment.