* @return none
* @param string $par (optional) user name of the user for which to show the contributions
*/
-function wfSpecialContributions( $par = '' ) {
+function wfSpecialContributions( $par = null ) {
global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest;
$fname = 'wfSpecialContributions';
// GET values
- $target = $par ? $par : $wgRequest->getVal( 'target' );
+ $target = isset($par) ? $par : $wgRequest->getVal( 'target' );
$namespace = $wgRequest->getVal( 'namespace', '' );
$namespace = $namespace === '' ? NULL : $namespace;
$invert = $wgRequest->getBool( 'invert' );
}
$action = $wgRequest->getVal( 'action' );
- if( empty( $par ) ) {
- $target = $wgRequest->getVal( 'target' );
- } else {
- $target = $par;
- }
+ $target = isset($par) ? $par : $wgRequest->getVal( 'target' );
if ( "" == $target ) {
wfDebug( "Target is empty.\n" );
$wgOut->errorpage( "notargettitle", "notargettext" );
$fname = 'wfSpecialRecentchangeslinked';
$days = $wgRequest->getInt( 'days' );
- $target = $wgRequest->getText( 'target' );
+ $target = isset($par) ? $par : $wgRequest->getText( 'target' );
$hideminor = $wgRequest->getBool( 'hideminor' ) ? 1 : 0;
$wgOut->setPagetitle( wfMsg( "recentchanges" ) );
$sk = $wgUser->getSkin();
- if( $par ) {
- $target = $par;
- }
- if ( $target == '') {
+ if (is_null($target)) {
$wgOut->errorpage( 'notargettitle', 'notargettext' );
return;
}
global $wgUser, $wgOut, $wgRequest;
$fname = 'wfSpecialWhatlinkshere';
- $target = $wgRequest->getVal( 'target' );
+ $target = isset($par) ? $par : $wgRequest->getVal( 'target' );
list( $limit, $offset ) = $wgRequest->getLimitOffset();
- if(!empty($par)) {
- $target = $par;
- } else if ( is_null( $target ) ) {
+ if (is_null($target)) {
$wgOut->errorpage( 'notargettitle', 'notargettext' );
return;
}