This repository was archived by the owner on Mar 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +14
-6
lines changed Expand file tree Collapse file tree 5 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ The official docker images are available on [Dockerhub](https://hub.docker.com/r
51
51
### CLI
52
52
53
53
```
54
- Mango - Manga Server and Web Reader. Version 0.26.0
54
+ Mango - Manga Server and Web Reader. Version 0.26.1
55
55
56
56
Usage:
57
57
Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ shards:
68
68
git: https://github.com/luislavena/radix.git
69
69
version: 0.4.1
70
70
71
+ sanitize:
72
+ git: https://github.com/hkalexling/sanitize.git
73
+ version: 0.1.0+git.commit.e09520e972d0d9b70b71bb003e6831f7c2c59dce
74
+
71
75
sqlite3:
72
76
git: https://github.com/crystal-lang/crystal-sqlite3.git
73
77
version: 0.18.0
Original file line number Diff line number Diff line change 1
1
name : mango
2
- version : 0.26.0
2
+ version : 0.26.1
3
3
4
4
authors :
5
5
- Alex Ling <hkalexling@gmail.com>
@@ -42,3 +42,5 @@ dependencies:
42
42
branch : master
43
43
mg :
44
44
github : hkalexling/mg
45
+ sanitize :
46
+ github : hkalexling/sanitize
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ require "option_parser"
7
7
require " clim"
8
8
require " tallboy"
9
9
10
- MANGO_VERSION = " 0.26.0 "
10
+ MANGO_VERSION = " 0.26.1 "
11
11
12
12
# From http://www.network-science.de/ascii/
13
13
BANNER = %{
Original file line number Diff line number Diff line change
1
+ require " sanitize"
2
+
1
3
struct AdminRouter
2
4
def initialize
3
5
get " /admin" do |env |
@@ -14,13 +16,13 @@ struct AdminRouter
14
16
end
15
17
16
18
get " /admin/user/edit" do |env |
17
- username = env.params.query[" username" ]?
19
+ sanitizer = Sanitize ::Policy ::Text .new
20
+ username = env.params.query[" username" ]?.try { |s | sanitizer.process s }
18
21
admin = env.params.query[" admin" ]?
19
22
if admin
20
23
admin = admin == " true"
21
24
end
22
- error = env.params.query[" error" ]?
23
- current_user = get_username env
25
+ error = env.params.query[" error" ]?.try { |s | sanitizer.process s }
24
26
new_user = username.nil? && admin.nil?
25
27
layout " user-edit"
26
28
end
You can’t perform that action at this time.
0 commit comments