r99148 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99147‎ | r99148 | r99149 >
Date:21:43, 6 October 2011
Author:platonides
Status:ok
Tags:
Comment:
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 (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -1613,7 +1613,7 @@
16141614 if ( $this->isCssJsSubpage ) {
16151615 # Check the skin exists
16161616 if ( $this->isWrongCaseCssJsPage ) {
1617 - $wgOut->wrapWikiMsg( "<div class='error' id='mw-userinvalidcssjstitle'>\n$1\n</div>", array( 'userinvalidcssjstitle', $this->getContextTitle()->getSkinFromCssJsSubpage() ) );
 1617+ $wgOut->wrapWikiMsg( "<div class='error' id='mw-userinvalidcssjstitle'>\n$1\n</div>", array( 'userinvalidcssjstitle', $this->mTitle->getSkinFromCssJsSubpage() ) );
16181618 }
16191619 if ( $this->formtype !== 'preview' ) {
16201620 if ( $this->isCssSubpage )
Index: trunk/phase3/includes/Title.php
@@ -2022,9 +2022,10 @@
20232023 public function getSkinFromCssJsSubpage() {
20242024 $subpage = explode( '/', $this->mTextform );
20252025 $subpage = $subpage[ count( $subpage ) - 1 ];
2026 - // FIXME: Should only match endings
2027 - // Consider 'Foo/.js.monobook' or 'Foo/mon.js.obook.css'
2028 - return( str_replace( array( '.css', '.js' ), array( '', '' ), $subpage ) );
 2026+ $lastdot = strrpos( $subpage, '.' );
 2027+ if ( $lastdot === false )
 2028+ return $subpage; # Never happens: only called for names ending in '.css' or '.js'
 2029+ return substr( $subpage, 0, $lastdot );
20292030 }
20302031
20312032 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99025Adding fixme comment above an old piece of code that I'd rather not change ri...krinkle18:45, 5 October 2011

Status & tagging log