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

Revision: 99148
Author:   platonides
Date:     2011-10-06 21:43:31 +0000 (Thu, 06 Oct 2011)
Log Message:
-----------
Solve the FIXME set in r99025.
Use $this->mTitle directly at EditPage instead of $this->getContextTitle()
$this->mTitle must be set, as it what was used to set 
$this->isWrongCaseCssJsPage

Modified Paths:
--------------
    trunk/phase3/includes/EditPage.php
    trunk/phase3/includes/Title.php

Modified: trunk/phase3/includes/EditPage.php
===================================================================
--- trunk/phase3/includes/EditPage.php  2011-10-06 21:41:36 UTC (rev 99147)
+++ trunk/phase3/includes/EditPage.php  2011-10-06 21:43:31 UTC (rev 99148)
@@ -1613,7 +1613,7 @@
                        if ( $this->isCssJsSubpage ) {
                                # Check the skin exists
                                if ( $this->isWrongCaseCssJsPage ) {
-                                       $wgOut->wrapWikiMsg( "<div 
class='error' id='mw-userinvalidcssjstitle'>\n$1\n</div>", array( 
'userinvalidcssjstitle', $this->getContextTitle()->getSkinFromCssJsSubpage() ) 
);
+                                       $wgOut->wrapWikiMsg( "<div 
class='error' id='mw-userinvalidcssjstitle'>\n$1\n</div>", array( 
'userinvalidcssjstitle', $this->mTitle->getSkinFromCssJsSubpage() ) );
                                }
                                if ( $this->formtype !== 'preview' ) {
                                        if ( $this->isCssSubpage )

Modified: trunk/phase3/includes/Title.php
===================================================================
--- trunk/phase3/includes/Title.php     2011-10-06 21:41:36 UTC (rev 99147)
+++ trunk/phase3/includes/Title.php     2011-10-06 21:43:31 UTC (rev 99148)
@@ -2022,9 +2022,10 @@
        public function getSkinFromCssJsSubpage() {
                $subpage = explode( '/', $this->mTextform );
                $subpage = $subpage[ count( $subpage ) - 1 ];
-               // FIXME: Should only match endings
-               // Consider 'Foo/.js.monobook' or 'Foo/mon.js.obook.css'
-               return( str_replace( array( '.css', '.js' ), array( '', '' ), 
$subpage ) );
+               $lastdot = strrpos( $subpage, '.' );
+               if ( $lastdot === false )
+                       return $subpage; # Never happens: only called for names 
ending in '.css' or '.js'
+               return substr( $subpage, 0, $lastdot );
        }
 
        /**


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to