mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-27 09:30:06 +00:00
Fix dynamic property usage
Status now provides declared $statusData property for holding
arbitrary data that can be used instead.
Bug: T326479
Depends-On: Ibe3f1f8b81bcfcb18551d3ca4cda464e4bdbcbce
Change-Id: I1342a8a8ca64b4040ed2b2d101d4574aedd888af
(cherry picked from commit 0ae3137ead
)
This commit is contained in:
parent
a07a4fdf94
commit
31b5986341
|
@ -913,14 +913,14 @@ class SimpleCaptcha {
|
|||
$page = MediaWikiServices::getInstance()->getWikiPageFactory()->newFromTitle( $title );
|
||||
if ( !$this->doConfirmEdit( $page, $content, '', $context, $user ) ) {
|
||||
$status->value = EditPage::AS_HOOK_ERROR_EXPECTED;
|
||||
$status->apiHookResult = [];
|
||||
$status->statusData = [];
|
||||
// give an error message for the user to know, what goes wrong here.
|
||||
// this can't be done for addurl trigger, because this requires one "free" save
|
||||
// for the user, which we don't know, when he did it.
|
||||
if ( $this->action === 'edit' ) {
|
||||
$status->fatal( 'captcha-edit-fail' );
|
||||
}
|
||||
$this->addCaptchaAPI( $status->apiHookResult );
|
||||
$this->addCaptchaAPI( $status->statusData );
|
||||
$key = CacheKeyHelper::getKeyForPage( $page );
|
||||
$this->activatedCaptchas[$key] = true;
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue