http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72362

Revision: 72362
Author:   tparscal
Date:     2010-09-04 09:44:01 +0000 (Sat, 04 Sep 2010)

Log Message:
-----------
Temporarily disable data URL embedding by default until we figure out how to 
make this work reliably. At least Chrome and possibly Opera were having issues 
with data URLs.

Modified Paths:
--------------
    trunk/phase3/includes/CSSMin.php
    trunk/phase3/includes/DefaultSettings.php

Modified: trunk/phase3/includes/CSSMin.php
===================================================================
--- trunk/phase3/includes/CSSMin.php    2010-09-04 09:29:25 UTC (rev 72361)
+++ trunk/phase3/includes/CSSMin.php    2010-09-04 09:44:01 UTC (rev 72362)
@@ -44,6 +44,7 @@
         * @return string Remapped CSS data
         */
        public static function remap( $source, $path ) {
+               global $wgUseDataURLs;
                $pattern = 
'/((?<embed>\s*\/\*\...@embed\s*\*\/)(?<rule>[^\;\}]*))?url\([\'"]?(?<file>[^\?\)\:]*)\??[^\)]*[\'"]?\)(?<extra>[^;]*)[\;]?/';
                $offset = 0;
                while ( preg_match( $pattern, $source, $match, 
PREG_OFFSET_CAPTURE, $offset ) ) {
@@ -57,7 +58,7 @@
                                // 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)

Modified: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php   2010-09-04 09:29:25 UTC (rev 
72361)
+++ trunk/phase3/includes/DefaultSettings.php   2010-09-04 09:44:01 UTC (rev 
72362)
@@ -1641,6 +1641,12 @@
  */
 $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
 
 /************************************************************************//**



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to