mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] Clamp admin report limit <1 to 100 (#1583)
* [bugfix] Clamp report limit <1 to 100 * add + update tests
This commit is contained in:
@@ -97,8 +97,7 @@ import (
|
||||
// type: integer
|
||||
// description: >-
|
||||
// Number of reports to return.
|
||||
// If less than 1, will be clamped to 1.
|
||||
// If more than 100, will be clamped to 100.
|
||||
// If more than 100 or less than 1, will be clamped to 100.
|
||||
// default: 20
|
||||
// in: query
|
||||
//
|
||||
@@ -163,9 +162,7 @@ func (m *Module) ReportsGETHandler(c *gin.Context) {
|
||||
}
|
||||
|
||||
// normalize
|
||||
if i <= 0 {
|
||||
i = 1
|
||||
} else if i >= 100 {
|
||||
if i < 1 || i > 100 {
|
||||
i = 100
|
||||
}
|
||||
limit = i
|
||||
|
Reference in New Issue
Block a user