Please add a trim to check_plain($_GET['regcode'])

If someone add a space like ?regcode=%20CODE regcode_load from that code will fail

  if (isset($_GET['regcode'])) {
        $form['regcode']['regcode_code']['#value']       = check_plain($_GET['regcode']);
        $form['regcode']['regcode_code']['#description'] = NULL;

New code with fix:

  if (isset($_GET['regcode'])) {
        $form['regcode']['regcode_code']['#value']       = trim(check_plain($_GET['regcode']));
        $form['regcode']['regcode_code']['#description'] = NULL;

Comments

scristian’s picture

Issue summary: View changes

small fix

ayesh’s picture

Version: 6.x-2.7 » 7.x-1.x-dev
Issue summary: View changes
Status: Active » Closed (fixed)

This is an old issue, hence closing it.
However, in the most recent code, there is a trim() call in place.See regcode_code_validate().