Skip to content
This repository was archived by the owner on Mar 23, 2025. It is now read-only.

Commit c831879

Browse files
authored
Merge pull request #293 from hkalexling/rc/0.26.1
v0.26.1
2 parents b8ce1cc + 171b446 commit c831879

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

shard.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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

shard.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: mango
2-
version: 0.26.0
2+
version: 0.26.1
33

44
authors:
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

src/mango.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require "option_parser"
77
require "clim"
88
require "tallboy"
99

10-
MANGO_VERSION = "0.26.0"
10+
MANGO_VERSION = "0.26.1"
1111

1212
# From http://www.network-science.de/ascii/
1313
BANNER = %{

src/routes/admin.cr

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require "sanitize"
2+
13
struct 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

0 commit comments

Comments
 (0)