jenkins-bot has submitted this change and it was merged.
Change subject: Update ConfirmEdit to return Status object on AbortNewAccount
hook
......................................................................
Update ConfirmEdit to return Status object on AbortNewAccount hook
Requires core update I6ae34c0 to actually send the message key back
in the error response. On older MediaWiki versions, behavior should
remain unchanged.
Bug: 60008
Change-Id: If9cc08e44d1d2efacf817b8c6cbb2d71a4e8b692
---
M Captcha.php
M ConfirmEditHooks.php
2 files changed, 7 insertions(+), 3 deletions(-)
Approvals:
CSteipp: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Captcha.php b/Captcha.php
index 19f70ae..2152ab5 100644
--- a/Captcha.php
+++ b/Captcha.php
@@ -537,13 +537,17 @@
* Hook for user creation form submissions.
* @param User $u
* @param string $message
+ * @param Status $status
* @return bool true to continue, false to abort user creation
*/
- function confirmUserCreate( $u, &$message ) {
+ function confirmUserCreate( $u, &$message, &$status = null ) {
if ( $this->needCreateAccountCaptcha() ) {
$this->trigger = "new account '" . $u->getName() . "'";
if ( !$this->passCaptcha() ) {
+ // For older MediaWiki
$message = wfMessage(
'captcha-createaccount-fail' )->text();
+ // For MediaWiki 1.23+
+ $status = Status::newFatal(
'captcha-createaccount-fail' );
return false;
}
}
diff --git a/ConfirmEditHooks.php b/ConfirmEditHooks.php
index c03e316..8126e2a 100644
--- a/ConfirmEditHooks.php
+++ b/ConfirmEditHooks.php
@@ -39,8 +39,8 @@
return self::getInstance()->injectUserCreate( $template );
}
- static function confirmUserCreate( $u, &$message ) {
- return self::getInstance()->confirmUserCreate( $u, $message );
+ static function confirmUserCreate( $u, &$message, &$status = null ) {
+ return self::getInstance()->confirmUserCreate( $u, $message,
$status );
}
static function triggerUserLogin( $user, $password, $retval ) {
--
To view, visit https://gerrit.wikimedia.org/r/108089
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If9cc08e44d1d2efacf817b8c6cbb2d71a4e8b692
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/ConfirmEdit
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: CSteipp <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits