Fix variable in ApiQueryProtectedTitles
authorMatěj Suchánek <matejsuchanek97@gmail.com>
Wed, 22 May 2019 18:07:08 +0000 (20:07 +0200)
committerMatěj Suchánek <matejsuchanek97@gmail.com>
Thu, 23 May 2019 16:57:23 +0000 (18:57 +0200)
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

index f526685..8edf00c 100644 (file)
@@ -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
                                        );
                                }