From d016d32dccccc12724df33289d81662b694a3ccf Mon Sep 17 00:00:00 2001 From: martimiz Date: Tue, 10 Jul 2012 14:23:18 +0200 Subject: [PATCH 1/2] MINOR: fixed deprecated code in MathSpamProtectorField Fixed some deprecated code following instructions in the deprecation notices. --- code/MathSpamProtectorField.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/code/MathSpamProtectorField.php b/code/MathSpamProtectorField.php index 754645d..bbf54af 100644 --- a/code/MathSpamProtectorField.php +++ b/code/MathSpamProtectorField.php @@ -18,20 +18,19 @@ class MathSpamProtectorField extends SpamProtectorField { * * @return HTML */ - function Field() { - if(self::is_enabled()) { + function Field($properties = array()) { + if(self::is_enabled($properties = array())) { $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); } } @@ -47,7 +46,7 @@ class MathSpamProtectorField extends SpamProtectorField { /** * Validates the value submitted by the user with the one saved - * into the {@link Session} and then notify callback object + * into the {@link Session} and then notify callback object * with the spam checking result. * * @return bool @@ -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" ); From 40164fd79d6f2e60a391280cc1ceeb9b61e2181e Mon Sep 17 00:00:00 2001 From: martimiz Date: Tue, 10 Jul 2012 15:10:36 +0200 Subject: [PATCH 2/2] MINOR: removed argument from self::is_enabled() in MathSpamProtectorField ln22 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was wrongly pasted there in an earlier commit… --- code/MathSpamProtectorField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/MathSpamProtectorField.php b/code/MathSpamProtectorField.php index bbf54af..91bdcf0 100644 --- a/code/MathSpamProtectorField.php +++ b/code/MathSpamProtectorField.php @@ -19,7 +19,7 @@ class MathSpamProtectorField extends SpamProtectorField { * @return HTML */ function Field($properties = array()) { - if(self::is_enabled($properties = array())) { + if(self::is_enabled()) { $attributes = array( 'type' => 'text', 'class' => 'text ' . ($this->extraClass() ? $this->extraClass() : ''),