From: Platonides Date: Thu, 6 Oct 2011 21:43:31 +0000 (+0000) Subject: Solve the FIXME set in r99025. X-Git-Tag: 1.31.0-rc.0~27217 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=8c39715cf03dcda8d2d4344729937058e74defa3;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 3bc0108d26..6714e0f047 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1613,7 +1613,7 @@ HTML if ( $this->isCssJsSubpage ) { # Check the skin exists if ( $this->isWrongCaseCssJsPage ) { - $wgOut->wrapWikiMsg( "
\n$1\n
", array( 'userinvalidcssjstitle', $this->getContextTitle()->getSkinFromCssJsSubpage() ) ); + $wgOut->wrapWikiMsg( "
\n$1\n
", array( 'userinvalidcssjstitle', $this->mTitle->getSkinFromCssJsSubpage() ) ); } if ( $this->formtype !== 'preview' ) { if ( $this->isCssSubpage ) diff --git a/includes/Title.php b/includes/Title.php index 39a1c4adf9..7bcde18c93 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2022,9 +2022,10 @@ class Title { 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 ); } /**