Elastic: Allow only numeric limit

This commit is contained in:
Jakub Vrana 2013-07-19 14:15:46 -07:00
parent c95be3adae
commit 39b5bd5fc4

View file

@ -93,7 +93,7 @@ if (isset($_GET["elastic"])) {
$query = "$table/_search?default_operator=AND"
. ($select != array("*") ? "&fields=" . urlencode(implode(",", $select)) : "")
. ($order ? "&sort=" . urlencode(ereg_replace(' DESC(,|$)', ':desc\1', implode(",", $order))) : "")
. ($limit ? "&size=$limit" . ($page ? "&from=" . ($page * $limit) : "") : "")
. ($limit ? "&size=" . (+$limit) . ($page ? "&from=" . ($page * $limit) : "") : "") // doesn't support returning all results
;
foreach ((array) $_GET["where"] as $val) {
if ("$val[col]$val[val]" != "") {