Skip to content

Commit

Permalink
MDL-44657 forms: Form identifiers should only contain basic characters
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden authored and Frederic Massart committed Nov 13, 2014
1 parent 683d7de commit 68ef378
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/formslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ function moodleform($action=null, $customdata=null, $method='post', $target='',
* @return string form identifier.
*/
protected function get_form_identifier() {
return get_class($this);
$class = get_class($this);

return preg_replace('/[^a-z0-9_]/i', '_', $class);
}

/**
Expand Down

0 comments on commit 68ef378

Please sign in to comment.