Skip to content

Commit

Permalink
chore: validate order param for payment query
Browse files Browse the repository at this point in the history
  • Loading branch information
ravinderk committed Jul 12, 2019
1 parent 176c7fe commit d91f4c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions includes/payments/class-payments-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ private function set_filters() {
// While set filters $args will get override and multiple get_payments call will not work.
$this->args = $this->_args;

// Whitelist order.
$this->args['order'] = in_array( strtoupper( $this->args['order'] ), array( 'ASC', 'DESC' ) ) ? $this->args['order'] : 'DESC' ;

$this->date_filter_pre();
$this->orderby();
$this->status();
Expand Down

0 comments on commit d91f4c6

Please sign in to comment.