From: Matěj Suchánek Date: Wed, 22 May 2019 18:07:08 +0000 (+0200) Subject: Fix variable in ApiQueryProtectedTitles X-Git-Tag: 1.34.0-rc.0~1609^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=64d24233143cb629b570a9d5382dc34f983820d6;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ); }