From ca9db69b406bf097ac91edda5fcb8777c01841ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Tue, 26 Jan 2021 00:02:15 +0100 Subject: [PATCH] Fix check for null edits Yet again, the CAPTCHA being neither an error nor a success bites us. Bug: T272922 Change-Id: I5ef85df452638ad3208e7a1cadad44c83237dbfe --- includes/ApiDiscussionToolsEdit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/ApiDiscussionToolsEdit.php b/includes/ApiDiscussionToolsEdit.php index c50d152a0..1ca7cc7e3 100644 --- a/includes/ApiDiscussionToolsEdit.php +++ b/includes/ApiDiscussionToolsEdit.php @@ -197,7 +197,7 @@ class ApiDiscussionToolsEdit extends ApiBase { break; } - if ( !isset( $result['newrevid'] ) ) { + if ( !isset( $result['newrevid'] ) && isset( $result['result'] ) && $result['result'] === 'success' ) { // No new revision, so no changes were made to the page (null edit). // Comment was not actually saved, so for this API, that's an error. // This is probably because changes were inside a transclusion's HTML?