Index: trunk/phase3/includes/CSSMin.php |
— | — | @@ -44,6 +44,7 @@ |
45 | 45 | * @return string Remapped CSS data |
46 | 46 | */ |
47 | 47 | public static function remap( $source, $path ) { |
| 48 | + global $wgUseDataURLs; |
48 | 49 | $pattern = '/((?<embed>\s*\/\*\s*\@embed\s*\*\/)(?<rule>[^\;\}]*))?url\([\'"]?(?<file>[^\?\)\:]*)\??[^\)]*[\'"]?\)(?<extra>[^;]*)[\;]?/'; |
49 | 50 | $offset = 0; |
50 | 51 | while ( preg_match( $pattern, $source, $match, PREG_OFFSET_CAPTURE, $offset ) ) { |
— | — | @@ -57,7 +58,7 @@ |
58 | 59 | // Add version parameter as a time-stamp in ISO 8601 format, using Z for the timezone, meaning GMT |
59 | 60 | $url = "{$file}?" . gmdate( 'Y-m-d\TH:i:s\Z', round( filemtime( $file ), -2 ) ); |
60 | 61 | // Detect when URLs were preceeded with embed tags, and also verify file size is below the limit |
61 | | - if ( $match['embed'][1] > 0 && filesize( $file ) < self::EMBED_SIZE_LIMIT ) { |
| 62 | + if ( $wgUseDataURLs && $match['embed'][1] > 0 && filesize( $file ) < self::EMBED_SIZE_LIMIT ) { |
62 | 63 | // If we ever get to PHP 5.3, we should use the Fileinfo extension instead of mime_content_type |
63 | 64 | $type = mime_content_type( $file ); |
64 | 65 | // Strip off any trailing = symbols (makes browsers freak out) |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1641,6 +1641,12 @@ |
1642 | 1642 | */ |
1643 | 1643 | $wgResourceLoaderServerMaxage = 30*24*60*60; // 30 days |
1644 | 1644 | |
| 1645 | +/** |
| 1646 | + * Enable data URL embedding (experimental). This variable is very temporary and |
| 1647 | + * will be removed once we get this feature stable. |
| 1648 | + */ |
| 1649 | +$wgUseDataURLs = false; |
| 1650 | + |
1645 | 1651 | /** @} */ # end of cache settings |
1646 | 1652 | |
1647 | 1653 | /************************************************************************//** |