Skip to content

Commit

Permalink
[login] Trim inputs before inserting into users or examiners (#5809)
Browse files Browse the repository at this point in the history
user_accounts and examiner modules trim whitespace around inputs before submission. request account does not do any trimming so entries like first/last name and emails get submitted with empty spaces around them.

Examiners with an incorrect Real_name value will cause a duplication of the examiner the first time the form is saved on user accounts because the name then gets trimmed and re-stored in it's correct format in the examiner table.

This results in a 500 error due to pselectRow returning more than one row.
  • Loading branch information
ridz1208 authored and driusan committed Nov 29, 2019
1 parent 7461730 commit da04429
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/login/php/requestaccount.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ class RequestAccount extends \NDB_Form
function _process($values)
{
$DB = \Database::singleton();
$name = htmlspecialchars($_REQUEST["firstname"], ENT_QUOTES);
$lastname = htmlspecialchars($_REQUEST["lastname"], ENT_QUOTES);
$from = htmlspecialchars($_REQUEST["from"], ENT_QUOTES);
$name = trim(htmlspecialchars($_REQUEST["firstname"], ENT_QUOTES));
$lastname = trim(htmlspecialchars($_REQUEST["lastname"], ENT_QUOTES));
$from = trim(htmlspecialchars($_REQUEST["from"], ENT_QUOTES));
$site = $_REQUEST["site"];
$fullname = $name." ".$lastname;

Expand Down

0 comments on commit da04429

Please sign in to comment.