* @return bool
*/
public function getFlip( $context ) {
- global $wgContLang;
-
- return $wgContLang->getDir() !== $context->getDirection();
+ return MediaWikiServices::getInstance()->getContentLanguage()->getDir() !==
+ $context->getDirection();
}
/**
* Note: It is expected that $context will be made non-optional in the near
* future.
*
- * @param ResourceLoaderContext $context
+ * @param ResourceLoaderContext|null $context
* @return array List of module names as strings
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
if ( !is_null( $deps ) ) {
$this->fileDeps[$vary] = self::expandRelativePaths(
- (array)FormatJson::decode( $deps, true )
+ (array)json_decode( $deps, true )
);
} else {
$this->fileDeps[$vary] = [];
return; // T124649; avoid write slams
}
- $deps = FormatJson::encode( $localPaths );
+ // No needless escaping as this isn't HTML output.
+ // Only stored in the database and parsed in PHP.
+ $deps = json_encode( $localPaths, JSON_UNESCAPED_SLASHES );
$dbw = wfGetDB( DB_MASTER );
$dbw->upsert( 'module_deps',
[