Skip to content

Commit 0867bfc

Browse files
committed
fix
1 parent 4b709db commit 0867bfc

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

modules/auth/password/hash/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func parseIntParam(value, param, algorithmName, config string, previousErr error
1919
return parsed, previousErr // <- Keep the previous error as this function should still return an error once everything has been checked if any call failed
2020
}
2121

22-
func parseUintParam[T uint32 | uint8](value, param, algorithmName, config string, previousErr error) (ret T, _ error) { //nolint:unparam // algorithmName is always argon2
22+
func parseUintParam[T uint32 | uint8](value, param, algorithmName, config string, previousErr error) (ret T, _ error) {
2323
_, isUint32 := any(ret).(uint32)
2424
parsed, err := strconv.ParseUint(value, 10, util.Iif(isUint32, 32, 8))
2525
if err != nil {

routers/web/repo/activity.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func Activity(ctx *context.Context) {
4545
}
4646
ctx.Data["DateFrom"] = timeFrom
4747
ctx.Data["DateUntil"] = timeUntil
48-
ctx.Data["Period"] = ctx.Data["Period"]
48+
ctx.Data["Period"] = period
4949
ctx.Data["PeriodText"] = ctx.Tr("repo.activity.period." + period)
5050

5151
canReadCode := ctx.Repo.CanRead(unit.TypeCode)

web_src/fomantic/build/components/dropdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ $.fn.dropdown = function(parameters) {
6666
moduleNamespace = 'module-' + namespace,
6767

6868
$module = $(this),
69-
$context = $(document).find(settings.context), // GITEA-PATCH: use "jQuery.find(selector)" instead of "jQuery(selector)"
69+
$context = (typeof settings.context === 'string') ? $(document).find(settings.context) : $(settings.context), // GITEA-PATCH: use "jQuery.find(selector)" instead of "jQuery(selector)"
7070
$text = $module.find(selector.text),
7171
$search = $module.find(selector.search),
7272
$sizer = $module.find(selector.sizer),

web_src/fomantic/build/components/modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ $.fn.modal = function(parameters) {
6464
moduleNamespace = 'module-' + namespace,
6565

6666
$module = $(this),
67-
$context = $(document).find(settings.context), // GITEA-PATCH: use "jQuery.find(selector)" instead of "jQuery(selector)"
67+
$context = (typeof settings.context === 'string') ? $(document).find(settings.context) : $(settings.context), // GITEA-PATCH: use "jQuery.find(selector)" instead of "jQuery(selector)"
6868
$close = $module.find(selector.close),
6969

7070
$allModals,

web_src/js/modules/fomantic/base.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export function linkLabelAndInput(label: Element, input: Element) {
1414
}
1515
}
1616

17-
export function fomanticQuery(s: string) {
18-
return $(document).find(s);
17+
export function fomanticQuery(s: string | Element | NodeListOf<Element>): ReturnType<typeof $> {
18+
// intentionally make it only work for query selector, it isn't used for creating HTML elements (for safety)
19+
return typeof s === 'string' ? $(document).find(s) : $(s);
1920
}

0 commit comments

Comments
 (0)