Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404969 )

Change subject: Always pass FileBackend instance to `new FileRepo()`
......................................................................

Always pass FileBackend instance to `new FileRepo()`

Score::$backend is only initialized if Score::getBackend() has been called,
but there are code paths in which getLength() will be called before that
function is ever called. Instead just use Score::getBackend(), which will
lazy-load the backend object, ensuring that we always pass one to FileRepo.

Bug: T185204
Change-Id: Id75c270e1ee49bd94db06c11353b7be9ecb773de
---
M includes/Score.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Score 
refs/changes/69/404969/1

diff --git a/includes/Score.php b/includes/Score.php
index ca32ab4..492b14c 100644
--- a/includes/Score.php
+++ b/includes/Score.php
@@ -1034,7 +1034,7 @@
                $isFileMp3 = pathinfo( $path, PATHINFO_EXTENSION ) === 'mp3';
                $repo = new FileRepo( [
                        'name' => 'foo',
-                       'backend' => self::$backend
+                       'backend' => self::getBackend()
                ] );
 
                $f = new UnregisteredLocalFile( false, $repo, $path, $isFileMp3

-- 
To view, visit https://gerrit.wikimedia.org/r/404969
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id75c270e1ee49bd94db06c11353b7be9ecb773de
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Score
Gerrit-Branch: master
Gerrit-Owner: Legoktm <lego...@member.fsf.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to