Catrope has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/381485 )
Change subject: Revert "CSSMin: Mangle whitespace in embedded SVGs"
......................................................................
Revert "CSSMin: Mangle whitespace in embedded SVGs"
This reverts commit dfd42d2653ea9ff2ca05dab7cd6f2285abba9d08.
Bug: T176884
Change-Id: Iddc98332d0b5a31d3a1c56c14014a53a06393f21
(cherry picked from commit ae336d89efc3b06dce802c3a337267142badb447)
---
M includes/libs/CSSMin.php
M tests/phpunit/includes/libs/CSSMinTest.php
2 files changed, 2 insertions(+), 9 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/85/381485/1
diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php
index a9c021e..adaae17 100644
--- a/includes/libs/CSSMin.php
+++ b/includes/libs/CSSMin.php
@@ -150,14 +150,7 @@
'%3A' => ':', // Unencode colons
'%3D' => '=', // Unencode equals signs
'%22' => '"', // Unencode double quotes
- '%0A' => ' ', // Change newlines to spaces
- '%0D' => ' ', // Change carriage returns to
spaces
- '%09' => ' ', // Change tabs to spaces
] );
- // Consolidate runs of multiple spaces in a row
- $encoded = preg_replace( '/ {2,}/', ' ', $encoded );
- // Remove leading and trailing spaces
- $encoded = preg_replace( '/^ | $/', '', $encoded );
$uri = 'data:' . $type . ',' . $encoded;
if ( !$ie8Compat || strlen( $uri ) <
self::DATA_URI_SIZE_LIMIT ) {
return $uri;
diff --git a/tests/phpunit/includes/libs/CSSMinTest.php
b/tests/phpunit/includes/libs/CSSMinTest.php
index a770fa4..62f990b 100644
--- a/tests/phpunit/includes/libs/CSSMinTest.php
+++ b/tests/phpunit/includes/libs/CSSMinTest.php
@@ -271,9 +271,9 @@
// data: URIs for red.gif, green.gif, circle.svg
$red =
'data:image/gif;base64,R0lGODlhAQABAIAAAP8AADAAACwAAAAAAQABAAACAkQBADs=';
$green =
'data:image/gif;base64,R0lGODlhAQABAIAAAACAADAAACwAAAAAAQABAAACAkQBADs=';
- $svg = 'data:image/svg+xml,%3C%3Fxml version="1.0"
encoding="UTF-8"%3F%3E '
+ $svg = 'data:image/svg+xml,%3C%3Fxml version="1.0"
encoding="UTF-8"%3F%3E%0A'
. '%3Csvg xmlns="http://www.w3.org/2000/svg" width="8"
height='
- . '"8"%3E %3Ccircle cx="4" cy="4" r="2"/%3E %3C/svg%3E';
+ . '"8"%3E%0A%09%3Ccircle cx="4" cy="4"
r="2"/%3E%0A%3C/svg%3E%0A';
// @codingStandardsIgnoreStart Generic.Files.LineLength
return [
--
To view, visit https://gerrit.wikimedia.org/r/381485
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iddc98332d0b5a31d3a1c56c14014a53a06393f21
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.31.0-wmf.1
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits