You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
markup.sanitizer in app.ini does not support multiple rule entries as expectedΒ #9888
Activity
albertjin commentedon Jan 20, 2020
This is related to pull request #9075. After a bit investigation, the problem is related multiple value support in
gopkg.in/ini.v1.For the function
NewContext()in filemodules/setting/setting.goat around line 519, change lineCfg.Append(...)toini.ShadowLoad(...)as follows.We'll have error as follows using the example above.
zeripath commentedon Jan 20, 2020
I suspect shadowload here isn't right. We still need something that is going to append but with shadows
zeripath commentedon Jan 20, 2020
I think We need to replace the Empty() here:
gitea/modules/setting/setting.go
Line 520 in 7d7ab1e
With:
albertjin commentedon Jan 20, 2020
The same error
for this one,
zeripath commentedon Jan 20, 2020
Sorry I hadn't read your next issue - I was sorting out the shadow.
This is never gonna work.
We need to represent a matched group of values. These just need to be child sections.
I don't think we can workaround this it needs an actual code change.
cipherboy commentedon Mar 9, 2020
@albertjin / @zeripath:
Ah sorry -- I just saw this. Feel free to @mention me next time or drop me an email.
One idea would be a count parameter:
That'd also solve some of the clarity problems (and omitting a regex would be a blanket whitelist) and keys would now be unique.
Thoughts? Happy to implement whatever gets decided.
zeripath commentedon Mar 28, 2020
@cipherboy sorry it's taken me so long to reply to this.
I think the best option would actually be:
We can grab all these child sections quite easily from go-ini and even map them quite nicely to objects to result in a simple
[]*SanitizerRulesarrayFix sanitizer config - multiple rules (#11133)
zeripath commentedon May 12, 2020
Fixed by #11133
Fix sanitizer config - multiple rules (go-gitea#11133)