Commit cbf3f21e authored by Dries's avatar Dries

- Patch by Steven: fixed bug in pager_query().
parent 63f25211
......@@ -69,7 +69,12 @@ function pager_query($query, $limit = 10, $element = 0, $count_query = NULL) {
// Convert comma-separated $from to an array, used by other functions.
$pager_from_array = explode(',', $from);
return db_query_range($query, $args, (int)$pager_from_array[$element], (int)$limit);
if (count($args)) {
return db_query_range($query, $args, (int)$pager_from_array[$element], (int)$limit);
}
else {
return db_query_range($query, (int)$pager_from_array[$element], (int)$limit);
}
}
/**
......@@ -375,4 +380,4 @@ function pager_load_array($value, $element, $old_array) {
return $new_array;
}
?>
\ No newline at end of file
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment