Temporarily disable data URL embedding by default until we figure out how to make...
authorTrevor Parscal <tparscal@users.mediawiki.org>
Sat, 4 Sep 2010 09:44:01 +0000 (09:44 +0000)
committerTrevor Parscal <tparscal@users.mediawiki.org>
Sat, 4 Sep 2010 09:44:01 +0000 (09:44 +0000)
includes/CSSMin.php
includes/DefaultSettings.php

index e088114..76f3f98 100644 (file)
@@ -44,6 +44,7 @@ class CSSMin {
         * @return string Remapped CSS data
         */
        public static function remap( $source, $path ) {
+               global $wgUseDataURLs;
                $pattern = '/((?<embed>\s*\/\*\s*\@embed\s*\*\/)(?<rule>[^\;\}]*))?url\([\'"]?(?<file>[^\?\)\:]*)\??[^\)]*[\'"]?\)(?<extra>[^;]*)[\;]?/';
                $offset = 0;
                while ( preg_match( $pattern, $source, $match, PREG_OFFSET_CAPTURE, $offset ) ) {
@@ -57,7 +58,7 @@ class CSSMin {
                                // Add version parameter as a time-stamp in ISO 8601 format, using Z for the timezone, meaning GMT
                                $url = "{$file}?" . gmdate( 'Y-m-d\TH:i:s\Z', round( filemtime( $file ), -2 ) );
                                // Detect when URLs were preceeded with embed tags, and also verify file size is below the limit
-                               if ( $match['embed'][1] > 0 && filesize( $file ) < self::EMBED_SIZE_LIMIT ) {
+                               if ( $wgUseDataURLs && $match['embed'][1] > 0 && filesize( $file ) < self::EMBED_SIZE_LIMIT ) {
                                        // If we ever get to PHP 5.3, we should use the Fileinfo extension instead of mime_content_type
                                        $type = mime_content_type( $file );
                                        // Strip off any trailing = symbols (makes browsers freak out)
index bd7d0e0..aa76709 100644 (file)
@@ -1641,6 +1641,12 @@ $wgResourceLoaderClientMaxage = 30*24*60*60; // 30 days
  */
 $wgResourceLoaderServerMaxage = 30*24*60*60; // 30 days
 
+/**
+ * Enable data URL embedding (experimental). This variable is very temporary and
+ * will be removed once we get this feature stable.
+ */
+$wgUseDataURLs = false;
+
 /** @} */ # end of cache settings
 
 /************************************************************************//**