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
5151### CLI
5252
5353```
54- Mango - Manga Server and Web Reader. Version 0.26.0
54+ Mango - Manga Server and Web Reader. Version 0.26.1
5555
5656 Usage:
5757
Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ shards:
6868 git: https://github.com/luislavena/radix.git
6969 version: 0.4.1
7070
71+ sanitize:
72+ git: https://github.com/hkalexling/sanitize.git
73+ version: 0.1.0+git.commit.e09520e972d0d9b70b71bb003e6831f7c2c59dce
74+
7175 sqlite3:
7276 git: https://github.com/crystal-lang/crystal-sqlite3.git
7377 version: 0.18.0
Original file line number Diff line number Diff line change 11name : mango
2- version : 0.26.0
2+ version : 0.26.1
33
44authors :
55 - Alex Ling <hkalexling@gmail.com>
@@ -42,3 +42,5 @@ dependencies:
4242 branch : master
4343 mg :
4444 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"
77require " clim"
88require " tallboy"
99
10- MANGO_VERSION = " 0.26.0 "
10+ MANGO_VERSION = " 0.26.1 "
1111
1212# From http://www.network-science.de/ascii/
1313BANNER = %{
Original file line number Diff line number Diff line change 1+ require " sanitize"
2+
13struct AdminRouter
24 def initialize
35 get " /admin" do |env |
@@ -14,13 +16,13 @@ struct AdminRouter
1416 end
1517
1618 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 }
1821 admin = env.params.query[" admin" ]?
1922 if admin
2023 admin = admin == " true"
2124 end
22- error = env.params.query[" error" ]?
23- current_user = get_username env
25+ error = env.params.query[" error" ]?.try { |s | sanitizer.process s }
2426 new_user = username.nil? && admin.nil?
2527 layout " user-edit"
2628 end
You can’t perform that action at this time.
0 commit comments