Bug #40499 » concatenate_css_47.patch

Patch for 4.7.4 - Thomas Löffler, 2012-09-01 11:10

View differences:

t3lib/class.t3lib_compressor.php (revision )
188 188
				// if $options['baseDirectories'] set, we only include files below these directories
189 189
			if ((!isset($options['baseDirectories'])
190 190
			  || $this->checkBaseDirectory($filenameFromMainDir, array_merge($options['baseDirectories'], array($this->targetDirectory))))
191
			  && ($fileOptions['media'] === 'all')
192 191
			) {
193
				$filesToInclude[] = $filenameFromMainDir;
192
				$filesToInclude[trim($fileOptions['media'])][] = $filenameFromMainDir;
194 193
					// remove the file from the incoming file array
195 194
				unset($cssFiles[$key]);
196 195
			}
197 196
		}
198 197

  
199 198
		if (count($filesToInclude)) {
200
			$targetFile = $this->createMergedCssFile($filesToInclude);
199
			foreach ($filesToInclude as $media => $cssFilesToInclude) {
200
				$targetFile = $this->createMergedCssFile($cssFilesToInclude);
201
			$targetFileRelative = $this->relativePath . $targetFile;
202
			$concatenatedOptions = array(
203
				'file' => $targetFileRelative,
204
				'rel' => 'stylesheet',
201
				$targetFileRelative = $this->relativePath . $targetFile;
202
				$concatenatedOptions = array(
203
					'file' => $targetFileRelative,
204
					'rel' => 'stylesheet',
205
				'media' => 'all',
205
					'media' => $media,
206
				'compress' => TRUE,
207
			);
208
				// place the merged stylesheet on top of the stylesheets
209
			$cssFiles = array_merge(array($targetFileRelative => $concatenatedOptions), $cssFiles);
206
					'compress' => TRUE,
207
				);
208
					// place the merged stylesheet on top of the stylesheets
209
				$cssFiles = array_merge(array($targetFileRelative => $concatenatedOptions), $cssFiles);
210
			}
210 211
		}
211 212
		return $cssFiles;
212 213
	}
(2-2/3)