r66977 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66976‎ | r66977 | r66978 >
Date:18:04, 27 May 2010
Author:maxsem
Status:reverted (Comments)
Tags:
Comment:
edit.php: got rid of $wgTitle
Modified paths:
  • /trunk/phase3/maintenance/edit.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/edit.php
@@ -36,7 +36,7 @@
3737 }
3838
3939 public function execute() {
40 - global $wgUser, $wgTitle, $wgArticle;
 40+ global $wgUser, $wgArticle;
4141
4242 $userName = $this->getOption( 'u', 'Maintenance script' );
4343 $summary = $this->getOption( 's', '' );
@@ -53,12 +53,12 @@
5454 $wgUser->addToDatabase();
5555 }
5656
57 - $wgTitle = Title::newFromText( $this->getArg() );
58 - if ( !$wgTitle ) {
 57+ $title = Title::newFromText( $this->getArg() );
 58+ if ( !$title ) {
5959 $this->error( "Invalid title", true );
6060 }
6161
62 - $wgArticle = new Article( $wgTitle );
 62+ $wgArticle = new Article( $title );
6363
6464 # Read the text
6565 $text = $this->getStdin( Maintenance::STDIN_ALL );

Follow-up revisions

RevisionCommit summaryAuthorDate
r81611Revert r66977 (removing $wgTitle from edit.php). This doesn't break core, but...demon22:36, 6 February 2011

Comments

#Comment by Platonides (talk | contribs)   23:04, 1 June 2010

Any good reason for this?

I think it set $wgTitle so that other code / extensions relying on $wgTitle didn't break.

#Comment by MaxSem (talk | contribs)   14:21, 2 June 2010

It's due to bug 23307.

#Comment by 😂 (talk | contribs)   13:11, 27 September 2010

I know EditPage still relies on $wgTitle (it's the worst offender in core, iirc)

#Comment by Reedy (talk | contribs)   00:09, 7 January 2011

Does this cause any issues when using edit.php

Or is it fine?

#Comment by 😂 (talk | contribs)   15:15, 4 February 2011

Not when using the maintenance script itself. But like Platonides says above it might break some extensions.

Would feel safer reverting this for 1.17.

Status & tagging log