Skip to content

Commit

Permalink
Merge pull request #293 from hkalexling/rc/0.26.1
Browse files Browse the repository at this point in the history
v0.26.1
  • Loading branch information
hkalexling authored Apr 4, 2022
2 parents b8ce1cc + 171b446 commit c831879
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The official docker images are available on [Dockerhub](https://hub.docker.com/r
### CLI

```
Mango - Manga Server and Web Reader. Version 0.26.0
Mango - Manga Server and Web Reader. Version 0.26.1
Usage:
Expand Down
4 changes: 4 additions & 0 deletions shard.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ shards:
git: https://github.com/luislavena/radix.git
version: 0.4.1

sanitize:
git: https://github.com/hkalexling/sanitize.git
version: 0.1.0+git.commit.e09520e972d0d9b70b71bb003e6831f7c2c59dce

sqlite3:
git: https://github.com/crystal-lang/crystal-sqlite3.git
version: 0.18.0
Expand Down
4 changes: 3 additions & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: mango
version: 0.26.0
version: 0.26.1

authors:
- Alex Ling <hkalexling@gmail.com>
Expand Down Expand Up @@ -42,3 +42,5 @@ dependencies:
branch: master
mg:
github: hkalexling/mg
sanitize:
github: hkalexling/sanitize
2 changes: 1 addition & 1 deletion src/mango.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require "option_parser"
require "clim"
require "tallboy"

MANGO_VERSION = "0.26.0"
MANGO_VERSION = "0.26.1"

# From http://www.network-science.de/ascii/
BANNER = %{
Expand Down
8 changes: 5 additions & 3 deletions src/routes/admin.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "sanitize"

struct AdminRouter
def initialize
get "/admin" do |env|
Expand All @@ -14,13 +16,13 @@ struct AdminRouter
end

get "/admin/user/edit" do |env|
username = env.params.query["username"]?
sanitizer = Sanitize::Policy::Text.new
username = env.params.query["username"]?.try { |s| sanitizer.process s }
admin = env.params.query["admin"]?
if admin
admin = admin == "true"
end
error = env.params.query["error"]?
current_user = get_username env
error = env.params.query["error"]?.try { |s| sanitizer.process s }
new_user = username.nil? && admin.nil?
layout "user-edit"
end
Expand Down

0 comments on commit c831879

Please sign in to comment.