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)
这个提交包含在:
Ammarpad 2023-11-28 13:50:35 +01:00 提交者 Reedy
父节点 a07a4fdf94
当前提交 31b5986341
共有 1 个文件被更改,包括 2 次插入2 次删除

查看文件

@ -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;