Skip to content
Snippets Groups Projects
Commit b9a6663f authored by Andreas Gohr's avatar Andreas Gohr
Browse files

handle limit=0 correctly in authmysql/pgsql FS#2919

parent 9a2c73e8
No related branches found
No related tags found
No related merge requests found
......@@ -358,7 +358,12 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
if($this->_openDB()) {
$this->_lockTables("READ");
$sql = $this->_createSQLFilter($this->getConf('getUsers'), $filter);
$sql .= " ".$this->getConf('SortOrder')." LIMIT $first, $limit";
$sql .= " ".$this->getConf('SortOrder');
if($limit) {
$sql .= " LIMIT $first, $limit";
} elseif($first) {
$sql .= " LIMIT $first";
}
$result = $this->_queryDB($sql);
if(!empty($result)) {
......
......@@ -154,7 +154,9 @@ class auth_plugin_authpgsql extends auth_plugin_authmysql {
if($this->_openDB()) {
$this->_lockTables("READ");
$sql = $this->_createSQLFilter($this->conf['getUsers'], $filter);
$sql .= " ".$this->conf['SortOrder']." LIMIT $limit OFFSET $first";
$sql .= " ".$this->conf['SortOrder'];
if($limit) $sql .= " LIMIT $limit";
if($first) $sql .= " OFFSET $first";
$result = $this->_queryDB($sql);
foreach($result as $user)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment