Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/231897

Change subject: CSSMin: remove dot segments in relative local URLs
......................................................................

CSSMin: remove dot segments in relative local URLs

Call wfRemoveDotSegments() (if available) on relative local URLs, so that
relative dot segments are collapsed.

Change-Id: Icc1c23a2a7d96c869412965bd8c3730d3c3b3a53
---
M includes/libs/CSSMin.php
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/97/231897/1

diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php
index f415c9b..118463a 100644
--- a/includes/libs/CSSMin.php
+++ b/includes/libs/CSSMin.php
@@ -399,7 +399,7 @@
 
                if ( $local === false ) {
                        // Assume that all paths are relative to $remote, and 
make them absolute
-                       return $remote . '/' . $url;
+                       $url = $remote . '/' . $url;
                } else {
                        // We drop the query part here and instead make the 
path relative to $remote
                        $url = "{$remote}/{$file}";
@@ -418,8 +418,11 @@
                        }
                        // If any of these conditions failed (file missing, we 
don't want to embed it
                        // or it's not embeddable), return the URL (possibly 
with ?timestamp part)
-                       return $url;
                }
+               if ( function_exists( 'wfRemoveDotSegments' ) ) {
+                       $url = wfRemoveDotSegments( $url );
+               }
+               return $url;
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/231897
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc1c23a2a7d96c869412965bd8c3730d3c3b3a53
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>

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

Reply via email to