Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -1613,7 +1613,7 @@ |
1614 | 1614 | if ( $this->isCssJsSubpage ) { |
1615 | 1615 | # Check the skin exists |
1616 | 1616 | 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() ) ); |
1618 | 1618 | } |
1619 | 1619 | if ( $this->formtype !== 'preview' ) { |
1620 | 1620 | if ( $this->isCssSubpage ) |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -2022,9 +2022,10 @@ |
2023 | 2023 | public function getSkinFromCssJsSubpage() { |
2024 | 2024 | $subpage = explode( '/', $this->mTextform ); |
2025 | 2025 | $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 ); |
2029 | 2030 | } |
2030 | 2031 | |
2031 | 2032 | /** |