Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
683d7de
)
MDL-44657 forms: Form identifiers should only contain basic characters
author
Paul Holden
<pholden@greenhead.ac.uk>
Thu, 13 Nov 2014 08:20:16 +0000
(16:20 +0800)
committer
Frederic Massart
<fred@moodle.com>
Thu, 13 Nov 2014 08:20:28 +0000
(16:20 +0800)
lib/formslib.php
patch
|
blob
|
blame
|
history
diff --git
a/lib/formslib.php
b/lib/formslib.php
index
acb5db3
..
1291d31
100644
(file)
--- a/
lib/formslib.php
+++ b/
lib/formslib.php
@@
-211,7
+211,9
@@
abstract class moodleform {
* @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);
}
/**