diff --git a/LibreJS.html b/LibreJS.html deleted file mode 100644 index 4cf55cb..0000000 --- a/LibreJS.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - -
freepost.jsAGPL-3.0freepost.js
\ No newline at end of file diff --git a/database.php b/database.php index 7961967..3e99aa4 100644 --- a/database.php +++ b/database.php @@ -824,10 +824,18 @@ class Database { $query = $this->database->prepare ( 'UPDATE `user`' . - 'SET `about` = ?, `email` = ? ' . - 'WHERE `id` = ?'); - - $query->execute (array ($about, $email, $user_id)); + 'SET `about` = :about, `email` = :email ' . + 'WHERE `id` = :user_id'); + + $query->bindValue (':about', $about, PDO::PARAM_STR); + $query->bindValue (':user_id', $user_id, PDO::PARAM_INT); + + if (NULL == $email || '' == $email) + $query->bindValue (':email', NULL, PDO::PARAM_NULL); + else + $query->bindValue (':email', $email, PDO::PARAM_STR); + + $query->execute (); } /** @@ -1202,9 +1210,6 @@ class Database $this->database->beginTransaction(); - // Get the user - $user = self::get_post ($user_hash_id); - // Generate a new secret token (used for validation) $token = self::get_random_string (32); @@ -1224,7 +1229,7 @@ class Database $query->execute (array ($token, $user_hash_id)); - $affected_rows = $query->rowCount(); + $affected_rows = $query->rowCount (); $this->database->commit (); @@ -1249,7 +1254,7 @@ class Database $query = $this->database->prepare ( 'UPDATE `user`' . - 'SET `password` = SHA2(CONCAT(?, `salt`), 512), `passwordResetToken` = "", `passwordResetTokenExpire` = NULL ' . + 'SET `password` = SHA2(CONCAT(?, `salt`), 512), `passwordResetToken` = NULL, `passwordResetTokenExpire` = NULL ' . 'WHERE `passwordResetToken` = ? AND `passwordResetTokenExpire` > NOW()'); $query->execute (array ($new_password, $token)); diff --git a/template/footer.twig b/template/footer.twig index 8ee79a7..f8f7f99 100644 --- a/template/footer.twig +++ b/template/footer.twig @@ -4,7 +4,6 @@