mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-13 18:07:00 +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
3f66456db2
commit
257462293c
|
@ -923,14 +923,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