From 64d24233143cb629b570a9d5382dc34f983820d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C4=9Bj=20Such=C3=A1nek?= Date: Wed, 22 May 2019 20:07:08 +0200 Subject: [PATCH] Fix variable in ApiQueryProtectedTitles Linker::formatComment accepts a Title object or null whereas $titles is an array. I was working hard to reproduce a failure but I couldn't since this code will only be executed with an empty array (which evaluates to false when if-checked). Per Anomie's suggestion, there should be no argument. Discovered using phan. Change-Id: I5a4df146d077cd879347709a399dce8303f41ccc --- includes/api/ApiQueryProtectedTitles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/api/ApiQueryProtectedTitles.php b/includes/api/ApiQueryProtectedTitles.php index f5266850bd..8edf00cf57 100644 --- a/includes/api/ApiQueryProtectedTitles.php +++ b/includes/api/ApiQueryProtectedTitles.php @@ -135,7 +135,7 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase { if ( isset( $prop['parsedcomment'] ) ) { $vals['parsedcomment'] = Linker::formatComment( - $commentStore->getComment( 'pt_reason', $row )->text, $titles + $commentStore->getComment( 'pt_reason', $row )->text ); } -- 2.20.1