Merge "Send cache purges for action=raw after editing user css/js"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 7 Jan 2014 22:57:11 +0000 (22:57 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 7 Jan 2014 22:57:11 +0000 (22:57 +0000)
1  2 
includes/Title.php
skins/common/wikibits.js

diff --combined includes/Title.php
@@@ -3538,6 -3538,13 +3538,13 @@@ class Title 
                        }
                }
  
+               // If we are looking at a css/js user subpage, purge the action=raw.
+               if ( $this->isJsSubpage() ) {
+                       $urls[] = $this->getInternalUrl( 'action=raw&ctype=text/javascript' );
+               } elseif ( $this->isCssSubpage() ) {
+                       $urls[] = $this->getInternalUrl( 'action=raw&ctype=text/css' );
+               }
                wfRunHooks( 'TitleSquidURLs', array( $this, &$urls ) );
                return $urls;
        }
  
                if ( $moveOverRedirect ) {
                        $newid = $nt->getArticleID();
 +                      $newcontent = $newpage->getContent();
  
                        # Delete the old redirect. We don't save it to history since
                        # by definition if we've got here it's rather uninteresting.
                        # a conflict on the unique namespace+title index...
                        $dbw->delete( 'page', array( 'page_id' => $newid ), __METHOD__ );
  
 -                      $newpage->doDeleteUpdates( $newid );
 +                      $newpage->doDeleteUpdates( $newid, $newcontent );
                }
  
                # Save a null revision in the page's history notifying of the move
diff --combined skins/common/wikibits.js
@@@ -18,14 -18,7 +18,14 @@@ if ( mw.config.get( 'wgBreakFrames' ) 
        }
  }
  
 -win.redirectToFragment = function ( fragment ) {
 +/**
 + * Legacy function to scroll to an id while viewing the page over a redirect.
 + * Superseeded by module 'mediawiki.action.view.redirectToFragment' in version 1.23.
 + * Kepted because cache can contain still inline script calls to this function.
 + * Should be removed in version 1.24.
 + * @deprecated since 1.23 Use mediawiki.action.view.redirectToFragment instead
 + */
 +mw.log.deprecate( win, 'redirectToFragment', function ( fragment ) {
        var webKitVersion,
                match = navigator.userAgent.match( /AppleWebKit\/(\d+)/ );
        if ( match ) {
@@@ -53,7 -46,7 +53,7 @@@
                        } );
                }
        }
 -};
 +}, 'Use the module mediawiki.action.view.redirectToFragment instead.' );
  
  /**
   * User-agent sniffing.
@@@ -233,8 -226,11 +233,11 @@@ win.importScriptURI = function ( url ) 
        return s;
  };
  
- win.importStylesheet = function( page ) {
-       return win.importStylesheetURI( mw.config.get( 'wgScript' ) + '?action=raw&ctype=text/css&title=' + mw.util.wikiUrlencode( page ) );
+ win.importStylesheet = function ( page ) {
+       var uri = mw.config.get( 'wgScript' ) + '?title=' +
+               mw.util.wikiUrlencode( page ) +
+               '&action=raw&ctype=text/css';
+       return win.importStylesheetURI( uri );
  };
  
  win.importStylesheetURI = function( url, media ) {