r99807 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99806‎ | r99807 | r99808 >
Date:21:18, 14 October 2011
Author:johnduhart
Status:ok
Tags:
Comment:
Use the context, Luke

Also some spacing and extension credit tweaks
Modified paths:
  • /trunk/extensions/FundraiserLandingPage/FundraiserLandingPage.body.php (modified) (history)
  • /trunk/extensions/FundraiserLandingPage/FundraiserLandingPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FundraiserLandingPage/FundraiserLandingPage.php
@@ -17,9 +17,10 @@
1818 }
1919
2020 $wgExtensionCredits[ 'specialpage' ][ ] = array(
 21+ 'path' => __FILE__,
2122 'name' => 'FundraiserLandingPage',
2223 'author' => 'Peter Gehres',
23 - 'url' => '',
 24+ 'url' => 'http://www.mediawiki.org/wiki/Extension:FundraiserLandingPage',
2425 'description' => '',
2526 'descriptionmsg' => '',
2627 'version' => '1.0.0',
Index: trunk/extensions/FundraiserLandingPage/FundraiserLandingPage.body.php
@@ -12,30 +12,31 @@
1313 }
1414
1515 function execute( $par ) {
16 - global $wgRequest, $wgOut, $wgFundraiserLPDefaults;
 16+ global $wgFundraiserLPDefaults;
1717
 18+ $request = $this->getRequest();
1819 $this->setHeaders();
1920
2021 # load the querystring variables
21 - $values = $wgRequest->getValues();
 22+ $values = $request->getValues();
2223
2324 # clear output variable to be safe
24 - $output = "";
 25+ $output = '';
2526
2627 # get the required variables to use for the landing page
2728 # (escaping with both htmlspecialchars and wfEscapeWikiText since the
2829 # parameters are intending to reference templates)
29 - $template = wfEscapeWikiText( htmlspecialchars( $wgRequest->getText( 'template', $wgFundraiserLPDefaults[ 'template' ] ) ) );
30 - $appeal = wfEscapeWikiText( htmlspecialchars( $wgRequest->getText( 'appeal', $wgFundraiserLPDefaults[ 'appeal' ] ) ) );
31 - $form = wfEscapeWikiText( htmlspecialchars( $wgRequest->getText( 'form', $wgFundraiserLPDefaults[ 'form' ] ) ) );
 30+ $template = wfEscapeWikiText( htmlspecialchars( $request->getText( 'template', $wgFundraiserLPDefaults[ 'template' ] ) ) );
 31+ $appeal = wfEscapeWikiText( htmlspecialchars( $request->getText( 'appeal', $wgFundraiserLPDefaults[ 'appeal' ] ) ) );
 32+ $form = wfEscapeWikiText( htmlspecialchars( $request->getText( 'form', $wgFundraiserLPDefaults[ 'form' ] ) ) );
3233
3334 # begin generating the template call
3435 $output .= "{{ $template\n| appeal = $appeal\n| form = $form\n";
3536
3637 # add any parameters passed in the querystring
37 - foreach ( $values as $k=>$v){
 38+ foreach ( $values as $k=>$v ) {
3839 # skip the required variables
39 - if ( $k == "template" || $k == "appeal" || $k == "form" ){
 40+ if ( $k == "template" || $k == "appeal" || $k == "form" ) {
4041 continue;
4142 }
4243 # get the variables name and value
@@ -48,6 +49,6 @@
4950 $output .= "}}";
5051
5152 # print the output to the page
52 - $wgOut->addWikiText( $output );
 53+ $this->getOutput()->addWikiText( $output );
5354 }
5455 }
\ No newline at end of file

Status & tagging log