mirror of
https://github.com/silverstripe/silverstripe-mathspamprotection
synced 2024-10-22 08:05:52 +02:00
Merge pull request #5 from Martimiz/fixdeprecations
MINOR: fixed deprecated code in MathSpamProtectorField
This commit is contained in:
commit
0b28f5f32c
@ -18,20 +18,19 @@ class MathSpamProtectorField extends SpamProtectorField {
|
||||
*
|
||||
* @return HTML
|
||||
*/
|
||||
function Field() {
|
||||
function Field($properties = array()) {
|
||||
if(self::is_enabled()) {
|
||||
$attributes = array(
|
||||
'type' => 'text',
|
||||
'class' => 'text ' . ($this->extraClass() ? $this->extraClass() : ''),
|
||||
'id' => $this->id(),
|
||||
'name' => $this->Name(),
|
||||
'name' => $this->getName(),
|
||||
'value' => $this->Value(),
|
||||
'title' => $this->Title(),
|
||||
'tabindex' => $this->getTabIndex(),
|
||||
'tabindex' => $this->getAttribute('tabindex'),
|
||||
'maxlength' => ($this->maxLength) ? $this->maxLength : null,
|
||||
'size' => ($this->maxLength) ? min( $this->maxLength, 30 ) : null
|
||||
);
|
||||
|
||||
return $this->createTag('input', $attributes);
|
||||
}
|
||||
}
|
||||
@ -60,8 +59,7 @@ class MathSpamProtectorField extends SpamProtectorField {
|
||||
$this->name,
|
||||
_t(
|
||||
'MathSpamProtectionField.INCORRECTSOLUTION',
|
||||
"Incorrect solution to the spam protection question, please try again.",
|
||||
PR_MEDIUM
|
||||
"Incorrect solution to the spam protection question, please try again."
|
||||
),
|
||||
"error"
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user