r65653 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65652‎ | r65653 | r65654 >
Date:12:42, 29 April 2010
Author:demon
Status:deferred
Tags:
Comment:
More $wgTitle/$wgArticle cleanup
Modified paths:
  • /trunk/extensions/Commentbox/Commentbox.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Commentbox/Commentbox.php
@@ -33,17 +33,18 @@
3434 $wgHooks['OutputPageBeforeHTML'][] = 'wfExtensionCommentbox_Add';
3535
3636 function wfExtensionCommentbox_Add( &$op, &$text ) {
37 - global $wgUser, $wgArticle, $wgRequest, $action, $wgTitle,
 37+ global $wgUser, $wgRequest, $action,
3838 $wgCommentboxNamespaces, $wgCommentboxRows,
3939 $wgCommentboxColumns;
4040
41 - if ( !$wgTitle->exists() )
 41+ $title = $op->getTitle();
 42+ if ( !$title->exists() )
4243 return true;
4344
44 - if ( !$wgTitle->userCan( 'edit', true ) )
 45+ if ( !$title->userCan( 'edit', true ) )
4546 return true;
46 - if ( !array_key_exists( $wgTitle->getNamespace(), $wgCommentboxNamespaces )
47 - || !$wgCommentboxNamespaces[ $wgTitle->getNamespace() ] )
 47+ if ( !array_key_exists( $title->getNamespace(), $wgCommentboxNamespaces )
 48+ || !$wgCommentboxNamespaces[ $title->getNamespace() ] )
4849 return true;
4950 if ( !( $action == 'view' || $action == 'purge' || $action == 'submit' ) )
5051 return true;
@@ -67,7 +68,7 @@
6869 }
6970 $inhalt = wfMsgNoTrans( 'commentbox-prefill' );
7071 $save = wfMsgExt( 'commentbox-savebutton', 'escapenoentities' );
71 - $texttitle = htmlspecialchars( Title::makeName( $wgTitle->getNamespace(), $wgTitle->getText() ) );
 72+ $texttitle = htmlspecialchars( Title::makeName( $title->getNamespace(), $title->getText() ) );
7273
7374 $intro = wfMsgExt( 'commentbox-intro', 'parse' );
7475

Status & tagging log