r79893 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79892‎ | r79893 | r79894 >
Date:12:48, 9 January 2011
Author:catrope
Status:ok
Tags:
Comment:
Avoid dot bloat in paths
Modified paths:
  • /trunk/phase3/includes/resourceloader/ResourceLoaderFileModule.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/resourceloader/ResourceLoaderFileModule.php
@@ -493,8 +493,13 @@
494494 if ( $flip ) {
495495 $style = CSSJanus::transform( $style, true, false );
496496 }
497 - $dir = $this->getLocalPath( dirname( $path ) );
498 - $remoteDir = $this->getRemotePath( dirname( $path ) );
 497+ $dirname = dirname( $path );
 498+ if ( $dirname == '.' ) {
 499+ // If $path doesn't have a directory component, don't prepend a dot
 500+ $dirname = '';
 501+ }
 502+ $dir = $this->getLocalPath( $dirname );
 503+ $remoteDir = $this->getRemotePath( $dirname );
499504 // Get and register local file references
500505 $this->localFileRefs = array_merge(
501506 $this->localFileRefs,

Status & tagging log