MDL-65217 form: option to randomise element ids
This commit is contained in:
@@ -384,6 +384,10 @@ class HTML_QuickForm_element extends HTML_Common
|
||||
switch ($event) {
|
||||
case 'createElement':
|
||||
static::__construct($arg[0], $arg[1], $arg[2], $arg[3], $arg[4]);
|
||||
if ($caller->getAttribute('data-random-ids') && !$this->getAttribute('id')) {
|
||||
$this->_generateId();
|
||||
$this->updateAttributes(array('id' => $this->getAttribute('id') . '_' . random_string()));
|
||||
}
|
||||
break;
|
||||
case 'addElement':
|
||||
$this->onQuickFormEvent('createElement', $arg, $caller);
|
||||
|
||||
Reference in New Issue
Block a user