diff --git a/code/MathSpamProtectorField.php b/code/MathSpamProtectorField.php index 91bdcf0..26a72c0 100644 --- a/code/MathSpamProtectorField.php +++ b/code/MathSpamProtectorField.php @@ -26,7 +26,7 @@ class MathSpamProtectorField extends SpamProtectorField { 'id' => $this->id(), 'name' => $this->getName(), 'value' => $this->Value(), - 'title' => $this->Title(), + 'title' => $this->ATTTitle(), 'tabindex' => $this->getAttribute('tabindex'), 'maxlength' => ($this->maxLength) ? $this->maxLength : null, 'size' => ($this->maxLength) ? min( $this->maxLength, 30 ) : null @@ -44,6 +44,15 @@ class MathSpamProtectorField extends SpamProtectorField { return sprintf(_t('MathSpamProtectionField.SPAMQUESTION', "Spam protection question: %s"), self::get_math_question()); } + /** + * Returns the spam question for title attribute + * + * @return string + */ + function ATTTitle() { + return Convert::html2raw($this->Title()); + } + /** * Validates the value submitted by the user with the one saved * into the {@link Session} and then notify callback object