summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
authorUrban Müller2020-04-21 15:15:40 +0200
committerUrban Müller2020-04-21 15:15:40 +0200
commit6a80c9eb76c5828ae1584bab1019fd05eaf84984 (patch)
tree9b2c317c57ece073b891591f669ee55623579df6 /it_dbi.class
parent8b65a2b2426fd04d46c943c76af40347a611bcee (diff)
downloaditools-6a80c9eb76c5828ae1584bab1019fd05eaf84984.tar.gz
itools-6a80c9eb76c5828ae1584bab1019fd05eaf84984.tar.bz2
itools-6a80c9eb76c5828ae1584bab1019fd05eaf84984.zip
support safe LIMIT
Diffstat (limited to 'it_dbi.class')
-rw-r--r--it_dbi.class4
1 files changed, 4 insertions, 0 deletions
diff --git a/it_dbi.class b/it_dbi.class
index 8cf8d54..7c13eec 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -355,6 +355,10 @@ function _where($params)
else
$sep = ' OR ';
}
+ else if ($field == "LIMIT")
+ {
+ $stringquery .= " LIMIT " . (it::match('^[ ,\d]+$', $value) ?: it::error(['title' => "invalid LIMIT $value", 'body' => $params]) + 0);
+ }
else
{
$needs_where = true;