From: Roan Kattouw Date: Sun, 9 Jan 2011 16:24:09 +0000 (+0000) Subject: Fix bug in ResourceLoader causing LTR->RTL flipping to only be applied to the first... X-Git-Tag: 1.31.0-rc.0~32666 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=57c3b082a427841468a0fc1aa64f442428b9f707;p=lhc%2Fweb%2Fwiklou.git 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) --- 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 ) ) ); }