fix-register #12

Merged
lopar merged 2 commits from fix-register into master 2020-10-27 19:57:57 +00:00
Showing only changes of commit 7fe8318472 - Show all commits

View File

@ -10,11 +10,6 @@ if ($user->battle) {
exit(); exit();
} }
use Krugozor\Database\Mysql\Mysql as Mysql;
$db = Mysql::create("192.168.20.100", "battles", "bottle-neck-horse")
->setDatabaseName("battles")
->setCharset("utf8");
define('INFO_CHAR_LIMIT', 1500); define('INFO_CHAR_LIMIT', 1500);
$name = filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING); $name = filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING);
$oldpsw = filter_input(INPUT_POST, 'oldpsw', FILTER_SANITIZE_SPECIAL_CHARS); $oldpsw = filter_input(INPUT_POST, 'oldpsw', FILTER_SANITIZE_SPECIAL_CHARS);
@ -42,7 +37,7 @@ if ($name || $color || $hobbie) {
err('Максимальная длинна поля Хобби: ' . INFO_CHAR_LIMIT . ' символов!'); err('Максимальная длинна поля Хобби: ' . INFO_CHAR_LIMIT . ' символов!');
} else { } else {
$values = ['realname' => $name, 'color' => $color, 'info' => $hobbie]; $values = ['realname' => $name, 'color' => $color, 'info' => $hobbie];
$db->query('UPDATE users SET ?As WHERE id = ?i', $values, $user->id); db::c()->query('UPDATE users SET ?As WHERE id = ?i', $values, $user->id);
} }
} }