mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-09-23 18:30:21 +00:00
Revert "Replace depricating method IContextSource::getWikiPage && IContextSource::canUseWikiPage"
This reverts commit 0a221920ae
.
Bug: T285959
Change-Id: Idc0d2beae2f73c15515041153daa831da5c29eaa
This commit is contained in:
parent
0f01d41c9f
commit
cedfdae4c5
|
@ -851,10 +851,10 @@ class SimpleCaptcha {
|
|||
* @return bool
|
||||
*/
|
||||
public function confirmEditMerged( $context, $content, $status, $summary, $user, $minorEdit ) {
|
||||
$title = $context->getTitle();
|
||||
if ( !$title->canExist() ) {
|
||||
if ( !$context->canUseWikiPage() ) {
|
||||
// we check WikiPage only
|
||||
// try to get an appropriate title for this page
|
||||
$title = $context->getTitle();
|
||||
if ( $title instanceof Title ) {
|
||||
$title = $title->getFullText();
|
||||
} else {
|
||||
|
@ -867,8 +867,7 @@ class SimpleCaptcha {
|
|||
wfDebug( __METHOD__ . ': Skipped ConfirmEdit check: No WikiPage for title ' . $title );
|
||||
return true;
|
||||
}
|
||||
|
||||
$page = MediaWikiServices::getInstance()->getWikiPageFactory()->newFromTitle( $title );
|
||||
$page = $context->getWikiPage();
|
||||
if ( !$this->doConfirmEdit( $page, $content, '', $context, $user ) ) {
|
||||
$status->value = EditPage::AS_HOOK_ERROR_EXPECTED;
|
||||
$status->apiHookResult = [];
|
||||
|
|
Loading…
Reference in a new issue