From d37fa5498ce97d8c3714d24cde06cea1ccf18a70 Mon Sep 17 00:00:00 2001 From: paladox Date: Wed, 16 Aug 2023 16:37:29 -0400 Subject: [PATCH] Improve memory management in MirahezeMagicHooks --- includes/MirahezeMagicHooks.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/MirahezeMagicHooks.php b/includes/MirahezeMagicHooks.php index 13bd195c6..4af32f660 100644 --- a/includes/MirahezeMagicHooks.php +++ b/includes/MirahezeMagicHooks.php @@ -496,7 +496,8 @@ public static function onGlobalUserPageWikis( &$list ) { $config = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'mirahezemagic' ); $cwCacheDir = $config->get( 'CreateWikiCacheDirectory' ); if ( file_exists( "{$cwCacheDir}/databases.json" ) ) { - $databasesArray = json_decode( file_get_contents( "{$cwCacheDir}/databases.json" ), true ); + $databaseFile = file_get_contents( "{$cwCacheDir}/databases.json" ); + $databasesArray = json_decode( $databaseFile, true ); $list = array_keys( $databasesArray['combi'] ); return false; }