From 57c3b082a427841468a0fc1aa64f442428b9f707 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Sun, 9 Jan 2011 16:24:09 +0000 Subject: [PATCH] Fix bug in ResourceLoader causing LTR->RTL flipping to only be applied to the first CSS file of every module. Thanks to thedj for reporting and investigating this bug and to Nikerabbit for finding the culprit (bad use of array_map) --- includes/resourceloader/ResourceLoaderFileModule.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index e17a848264..d39cd46f59 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -464,12 +464,13 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { } $styles = self::collateFilePathListByOption( $styles, 'media', 'all' ); foreach ( $styles as $media => $files ) { + $uniqueFiles = array_unique( $files ); $styles[$media] = implode( "\n", array_map( array( $this, 'readStyleFile' ), - array_unique( $files ), - array( $flip ) + $uniqueFiles, + array_fill( 0, count( $uniqueFiles ), $flip ) ) ); } -- 2.20.1