https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112569
Revision: 112569
Author: tstarling
Date: 2012-02-28 02:55:36 +0000 (Tue, 28 Feb 2012)
Log Message:
-----------
Fix r110209: Move the invalid title check above the first use of the title
object, to avoid a fatal error, for example when navigating to
[[Special:MovePage]] with no target.
Modified Paths:
--------------
trunk/phase3/includes/specials/SpecialMovepage.php
Modified: trunk/phase3/includes/specials/SpecialMovepage.php
===================================================================
--- trunk/phase3/includes/specials/SpecialMovepage.php 2012-02-28 02:40:31 UTC
(rev 112568)
+++ trunk/phase3/includes/specials/SpecialMovepage.php 2012-02-28 02:55:36 UTC
(rev 112569)
@@ -55,6 +55,13 @@
$oldTitleText = $request->getVal( 'wpOldTitle', $target );
$this->oldTitle = Title::newFromText( $oldTitleText );
+ if( is_null( $this->oldTitle ) ) {
+ throw new ErrorPageError( 'notargettitle',
'notargettext' );
+ }
+ if( !$this->oldTitle->exists() ) {
+ throw new ErrorPageError( 'nopagetitle', 'nopagetext' );
+ }
+
$newTitleTextMain = $request->getText( 'wpNewTitleMain' );
$newTitleTextNs = $request->getInt( 'wpNewTitleNs',
$this->oldTitle->getNamespace() );
// Backwards compatibility for forms submitting here from other
sources
@@ -64,12 +71,6 @@
? Title::newFromText( $newTitleText_bc )
: Title::makeTitleSafe( $newTitleTextNs,
$newTitleTextMain );
- if( is_null( $this->oldTitle ) ) {
- throw new ErrorPageError( 'notargettitle',
'notargettext' );
- }
- if( !$this->oldTitle->exists() ) {
- throw new ErrorPageError( 'nopagetitle', 'nopagetext' );
- }
$user = $this->getUser();
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs