Skip to content

Commit 858574e

Browse files
author
DavideC03
committed
v09.01.04
1 parent afc741e commit 858574e

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

bin/parts/create_user_elem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function create($username, $sub_id){
4848
$stmt = $this->conn->prepare($query);
4949

5050
// Sanitize
51-
$username = htmlspecialchars(strip_tags(preg_replace("/[^".preg_quote($this->chars . $this->nums, "/")."]/", '', $username)));
51+
$username = htmlspecialchars(strip_tags(preg_replace("/[^".preg_quote($this->chars . $this->nums. "-", "/")."]/", '', $username)));
5252
$sub_id = htmlspecialchars(strip_tags(preg_replace("/[^".preg_quote($this->nums, "/")."]/", '', strval($sub_id))));
5353

5454
// Bind values

bin/parts/esec_elem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ public function create($input){
762762

763763
// sanitize
764764
$data = array();
765-
$data["username"] = htmlspecialchars(strip_tags(preg_replace("/[^".preg_quote($this->chars . $this->nums, "/")."]/", '', $input["username"])));
765+
$data["username"] = htmlspecialchars(strip_tags(preg_replace("/[^".preg_quote($this->chars . $this->nums . "-", "/")."]/", '', $input["username"])));
766766
$data["token"] = htmlspecialchars(strip_tags(preg_replace("/[^".preg_quote($this->chars . $this->nums, "/")."]/", '', $input["token"])));
767767
$data["answers"] = array();
768768
$data["answers"]["name"] = htmlspecialchars(strip_tags(preg_replace("/[^".preg_quote($this->chars . $this->nums, "/")."]/", '', $input["answers"]["name"])));

bin/parts/languages_elem.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class Languages{
1414
// class variabile(s)
1515
private $conn;
1616
private $table_name = "languages";
17-
private $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
18-
private $nums = "0123456789";
1917

2018
/**
2119
* Constructor

bin/parts/priority_elem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ public function create($input){
523523

524524
// sanitize
525525
$data = array();
526-
$data["username"] = htmlspecialchars(strip_tags(preg_replace("/[^".preg_quote($this->chars . $this->nums, "/")."]/", '', $input["username"])));
526+
$data["username"] = htmlspecialchars(strip_tags(preg_replace("/[^".preg_quote($this->chars . $this->nums . "-", "/")."]/", '', $input["username"])));
527527
$data["token"] = htmlspecialchars(strip_tags(preg_replace("/[^".preg_quote($this->chars . $this->nums, "/")."]/", '', $input["token"])));
528528
$data["server_id"] = htmlspecialchars(strip_tags(preg_replace("/[^".preg_quote($this->nums, "/")."]/", '', $input["server_id"])));
529529
$data["instruction"] = htmlspecialchars(strip_tags(preg_replace("/[^".preg_quote($this->chars, "/")."]/", '', $input["instruction"])));

docs/CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@
22
Repo containing the public part of the REST/API
33

44
- [Changelog](#changelog)
5-
- [[09.01.03] - 2021-07-08](#090103---2021-07-08)
5+
- [[09.01.04] - 2021-07-10](#090104---2021-07-10)
66
- [Changed](#changed)
7-
- [[09.01.02] - 2021-07-08](#090102---2021-07-08)
7+
- [[09.01.03] - 2021-07-08](#090103---2021-07-08)
88
- [Changed](#changed-1)
9+
- [[09.01.02] - 2021-07-08](#090102---2021-07-08)
10+
- [Changed](#changed-2)
911
- [[09.01.01] - 2021-06-19](#090101---2021-06-19)
1012
- [Added](#added)
1113

14+
## [09.01.04] - 2021-07-10
15+
### Changed
16+
- Now usernames can have "-" inside
17+
1218
## [09.01.03] - 2021-07-08
1319
### Changed
1420
- Fixed a bug in esec_elem.php file

0 commit comments

Comments
 (0)