about summary refs log tree commit diff stats
path: root/login.php
diff options
context:
space:
mode:
authorAndrew Dolgov <noreply@fakecake.org>2017-06-28 13:38:12 +0300
committerAndrew Dolgov <noreply@fakecake.org>2017-06-28 13:38:12 +0300
commit33709de21e902e7a3e593883fc18c94361eb3c37 (patch)
tree73b42ec40c96378b03552141c3bba9aae6669fa3 /login.php
parent4a929e9595928e744b23575e564c9d931c4e54ed (diff)
downloadthe-epube-33709de21e902e7a3e593883fc18c94361eb3c37.tar.gz
the-epube-33709de21e902e7a3e593883fc18c94361eb3c37.tar.xz
users: force lowercase; remove spaces
Diffstat (limited to 'login.php')
-rw-r--r--login.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/login.php b/login.php
index 3f2c5f2..ddb25b5 100644
--- a/login.php
+++ b/login.php
@@ -5,8 +5,8 @@
 	@$op = $_REQUEST["op"];
 
 	if ($op == "perform-login") {
-		$user = SQLite3::escapeString($_REQUEST["user"]);
-		$password = SQLite3::escapeString('SHA256:' . hash('sha256', "$user:" . $_REQUEST["password"]));
+		$user = SQLite3::escapeString(trim(mb_strtolower($_REQUEST["user"])));
+		$password = SQLite3::escapeString('SHA256:' . hash('sha256', "$user:" . trim($_REQUEST["password"])));
 
 		$dbh = Db::get();