r109339 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109338‎ | r109339 | r109340 >
Date:08:00, 18 January 2012
Author:neilk
Status:ok
Tags:
Comment:
get the url for the special page in a more correct way
Modified paths:
  • /trunk/extensions/CongressLookup/CongressLookup.php (modified) (history)
  • /trunk/extensions/CongressLookup/SpecialCongressLookup.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CongressLookup/CongressLookup.php
@@ -45,9 +45,10 @@
4646 $wgCongressLookupSharedMaxAge = 1200; // 20 minutes server-side
4747 $wgCongressLookupMaxAge = 600; // 10 minutes client-side
4848
49 -// Where to report errors
50 -$wgCongressLookupErrorPage = '/wiki/Special:CongressFail';
 49+// Where to report errors (special page)
 50+$wgCongressLookupErrorPage = 'CongressFail';
5151
 52+
5253 $dir = dirname( __FILE__ ) . '/';
5354
5455 //API
Index: trunk/extensions/CongressLookup/SpecialCongressLookup.php
@@ -309,10 +309,13 @@
310310 $congressTable .= Html::element( 'p', array(), wfMsg( 'congresslookup-no-senators' ) );
311311 }
312312
 313+ $errorPage = SpecialPage::getTitleFor( $wgCongressLookupErrorPage );
 314+ $errorUrl = $errorPage->getLocalURL( array( 'zip' => $wgRequest->getVal( 'zip' ) ) );
 315+
313316 $congressTable .= Html::openElement( 'p' );
314317 $congressTable .= Html::element(
315318 'a',
316 - array ( 'href' => $wgCongressLookupErrorPage . '?zip=' . $wgRequest->getVal( 'zip' ) ),
 319+ array ( 'href' => $errorUrl ),
317320 wfMsg( 'congresslookup-report-errors' )
318321 );
319322 $congressTable .= Html::closeElement( 'p' );

Status & tagging log