Skip to content

Commit

Permalink
Merge branch 'QA_4_6-security' into master-security
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Aug 18, 2016
2 parents 16da933 + d62494c commit d3e4fad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libraries/DbQbe.php
Expand Up @@ -1946,7 +1946,10 @@ private function _initializeCriteriasCount()
// sets row count
$rows = PMA_ifSetOr($_REQUEST['rows'], 0, 'numeric');
$criteriaRowAdd = PMA_ifSetOr($_REQUEST['criteriaRowAdd'], 0, 'numeric');
$this->_criteria_row_count = max($rows + $criteriaRowAdd, 0);
$this->_criteria_row_count = min(
100,
max($rows + $criteriaRowAdd, 0)
);

return $criteriaColumnCount;
}
Expand Down
10 changes: 10 additions & 0 deletions libraries/SavedSearches.php
Expand Up @@ -160,6 +160,16 @@ public function setCriterias($criterias, $json = false)
}
}

/* Limit amount of rows */
if (!isset($data['rows'])) {
$data['rows'] = 0;
} else {
$data['rows'] = min(
max(0, intval($data['rows'])),
100
);
}

for ($i = 0; $i <= $data['rows']; $i++) {
$data['Or' . $i] = $criterias['Or' . $i];
}
Expand Down

0 comments on commit d3e4fad

Please sign in to comment.