Fix syntax

This commit is contained in:
patrick 2025-02-12 22:55:55 +00:00
parent 790ba92692
commit 6730e9ba8a

View File

@ -713,9 +713,9 @@ function user_dupe_row($table, $key, $val, $newval)
$keys = '`' . join('`,`', array_keys($i)) . '`';
$vals = join(',', array_values($i));
$q = "INSERT INTO $table (?) VALUES (?)";
$q = "INSERT INTO $table ($keys) VALUES ($vals)";
$r = $pdo->prepare($q);
$r->execute([$keys, $vals]);
$r->execute();
show_pdo_errors_if_any($pdo);
$id = $pdo->lastInsertId();
@ -867,7 +867,7 @@ function user_valid_user($user)
function user_valid_password($pass)
{
/* Same as user, but allow more characters */
$x = preg_match('/[^a-zA-Z0-9 ~!@#$%^&*()-_=+|;:,<.>/?]/', $pass);
$x = preg_match('[^a-zA-Z0-9 ~!@#$%^&*()-_=+|;:,<.>/?]', $pass);
/* If x==1, a match was found, and the input is bad */
if ($x == 1)