PFAHandler:

- read_from_db(): convert $limit and $offset with (int) to make sure
  they contain a sane value


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1584 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 11 years ago
parent 79274dcedf
commit 53c28990ad

@ -460,9 +460,9 @@ abstract class PFAHandler {
$query = "SELECT $cols FROM $table $extrafrom $where ORDER BY " . $this->id_field;
$limit = (int) $limit; # make sure $limit and $offset are really integers
$offset = (int) $offset;
if ($limit > -1 && $offset > -1) {
# TODO: make sure $limit and $offset are really integers - cast via (int) ?
# TODO: make sure $limit is > 0 (0 doesn't break anything, but guarantees an empty resultset, so it's pointless)
$query .= " LIMIT $limit OFFSET $offset ";
}

Loading…
Cancel
Save