diff --git a/includes/BadFileLookup.php b/includes/BadFileLookup.php index cdf569a80f9..8419f1082bc 100644 --- a/includes/BadFileLookup.php +++ b/includes/BadFileLookup.php @@ -11,8 +11,8 @@ use RepoGroup; use TitleParser; class BadFileLookup { - /** @var callable Returns contents of blacklist (see comment for isBadFile()) */ - private $blacklistCallback; + /** @var callable Returns contents of bad file list (see comment for isBadFile()) */ + private $listCallback; /** @var BagOStuff Cache of parsed bad image list */ private $cache; @@ -23,7 +23,7 @@ class BadFileLookup { /** @var TitleParser */ private $titleParser; - /** @var array|null Parsed blacklist */ + /** @var array|null Parsed bad file list */ private $badFiles; /** @var HookRunner */ @@ -32,20 +32,20 @@ class BadFileLookup { /** * Do not call directly. Use MediaWikiServices. * - * @param callable $blacklistCallback Callback that returns wikitext of a file blacklist - * @param BagOStuff $cache For caching parsed versions of the blacklist + * @param callable $listCallback Callback that returns wikitext of a bad file list + * @param BagOStuff $cache For caching parsed versions of the bad file list * @param RepoGroup $repoGroup * @param TitleParser $titleParser * @param HookContainer $hookContainer */ public function __construct( - callable $blacklistCallback, + callable $listCallback, BagOStuff $cache, RepoGroup $repoGroup, TitleParser $titleParser, HookContainer $hookContainer ) { - $this->blacklistCallback = $blacklistCallback; + $this->listCallback = $listCallback; $this->cache = $cache; $this->repoGroup = $repoGroup; $this->titleParser = $titleParser; @@ -83,15 +83,15 @@ class BadFileLookup { if ( $this->badFiles === null ) { // Not used before in this request, try the cache - $blacklist = ( $this->blacklistCallback )(); - $key = $this->cache->makeKey( 'bad-image-list', sha1( $blacklist ) ); + $list = ( $this->listCallback )(); + $key = $this->cache->makeKey( 'bad-image-list', sha1( $list ) ); $this->badFiles = $this->cache->get( $key ) ?: null; } if ( $this->badFiles === null ) { // Cache miss, build the list now $this->badFiles = []; - $lines = explode( "\n", $blacklist ); + $lines = explode( "\n", $list ); foreach ( $lines as $line ) { // List items only if ( substr( $line, 0, 1 ) !== '*' ) {