return '';
}
if ( !is_array( $input ) ) {
- $input = array(
- $input
- );
+ $input = array( $input );
}
if ( count( $input ) > 0 ) {
- $msg = $title . ( count( $input ) > 1 ? 's' : '' ) . ":\n ";
+ if ( $title ) {
+ $msg = $title . ( count( $input ) > 1 ? 's' : '' ) . ":\n ";
+ } else {
+ $msg = ' ';
+ }
$msg .= implode( $prefix, $input ) . "\n";
return $msg;
}
$redirValues = array();
foreach ( $titles as $id => $newTitle ) {
- if ( !isset( $titles[ $id - 1 ] ) ) {
- $titles[ $id - 1 ] = $oldTitle;
+ if ( !isset( $titles[$id - 1] ) ) {
+ $titles[$id - 1] = $oldTitle;
}
$redirValues[] = array(
- 'from' => $titles[ $id - 1 ]->getPrefixedText(),
+ 'from' => $titles[$id - 1]->getPrefixedText(),
'to' => $newTitle->getPrefixedText()
);
$this->dieUsage( 'Syndication feeds are not available', 'feed-unavailable' );
}
- if( !isset( $wgFeedClasses[ $params['feedformat'] ] ) ) {
+ if( !isset( $wgFeedClasses[$params['feedformat']] ) ) {
$this->dieUsage( 'Invalid subscription feed type', 'feed-invalid' );
}
$this->dieUsage( 'Syndication feeds are not available', 'feed-unavailable' );
}
- if( !isset( $wgFeedClasses[ $params['feedformat'] ] ) ) {
+ if( !isset( $wgFeedClasses[$params['feedformat']] ) ) {
$this->dieUsage( 'Invalid subscription feed type', 'feed-invalid' );
}
if ( !is_null( $params['wlexcludeuser'] ) ) {
if ( !$table ) {
$chars = ';@$!*(),/:';
for ( $i = 0; $i < strlen( $chars ); $i++ ) {
- $table[ rawurlencode( $chars[$i] ) ] = $chars[$i];
+ $table[rawurlencode( $chars[$i] )] = $chars[$i];
}
}
return strtr( rawurlencode( $s ), $table );
foreach ( array_keys( $this->mModules ) as $moduleName ) {
$module = new $this->mModules[$moduleName] ( $this, $moduleName );
$msg .= self::makeHelpMsgHeader( $module, 'action' );
+
$msg2 = $module->makeHelpMsg();
if ( $msg2 !== false ) {
$msg .= $msg2;
$msg .= "\n$astriks Permissions $astriks\n\n";
foreach ( self::$mRights as $right => $rightMsg ) {
$groups = User::getGroupsWithPermission( $right );
- $msg .= "* " . $right . " *\n " . wfMsgReplaceArgs( $rightMsg[ 'msg' ], $rightMsg[ 'params' ] ) .
+ $msg .= "* " . $right . " *\n " . wfMsgReplaceArgs( $rightMsg['msg'], $rightMsg['params'] ) .
"\nGranted to:\n " . str_replace( '*', 'all', implode( ', ', $groups ) ) . "\n\n";
-
}
$msg .= "\n$astriks Formats $astriks\n\n";
}
}
- $watch = "preferences";
+ $watch = 'preferences';
if ( isset( $params['watchlist'] ) ) {
$watch = $params['watchlist'];
} elseif ( $params['watch'] ) {
$text = Language::fetchLanguageName( $nt->getInterwiki() );
$langs[] = Html::element( 'a',
- array( 'href' => $nt->getFullURL(), 'title' => $nt->getText(), 'class' => "external" ),
+ array( 'href' => $nt->getFullURL(), 'title' => $nt->getText(), 'class' => 'external' ),
$text == '' ? $l : $text );
}
$s .= implode( wfMessage( 'pipe-separator' )->escaped(), $langs );
if ( $wgContLang->isRTL() ) {
- $s = Html::rawElement( 'span', array( 'dir' => "LTR" ), $s );
+ $s = Html::rawElement( 'span', array( 'dir' => 'LTR' ), $s );
}
return $s;
if ( $params['unique'] ) {
$this->setContinueEnumParameter( 'continue', $row->pl_title );
} else {
- $this->setContinueEnumParameter( 'continue', $row->pl_title . "|" . $row->pl_from );
+ $this->setContinueEnumParameter( 'continue', $row->pl_title . '|' . $row->pl_from );
}
break;
}
if ( $params['unique'] ) {
$this->setContinueEnumParameter( 'continue', $row->pl_title );
} else {
- $this->setContinueEnumParameter( 'continue', $row->pl_title . "|" . $row->pl_from );
+ $this->setContinueEnumParameter( 'continue', $row->pl_title . '|' . $row->pl_from );
}
break;
}
}
if ( $customiseFilterEnabled ) {
- $messageIsCustomised = isset( $customisedMessages['pages'][ $langObj->ucfirst( $message ) ] );
+ $messageIsCustomised = isset( $customisedMessages['pages'][$langObj->ucfirst( $message )] );
if ( $customised === $messageIsCustomised ) {
if ( $customised ) {
$a['customised'] = '';
ApiBase::PARAM_ISMULTI => true,
ApiBase::PARAM_TYPE => 'namespace'
),
- 'dir' => array(\r
- ApiBase::PARAM_DFLT => 'ascending',\r
- ApiBase::PARAM_TYPE => array(\r
- 'ascending',\r
- 'descending'\r
- )\r
+ 'dir' => array(
+ ApiBase::PARAM_DFLT => 'ascending',
+ ApiBase::PARAM_TYPE => array(
+ 'ascending',
+ 'descending'
+ )
),
'filterredir' => array(
ApiBase::PARAM_DFLT => 'all',
// Add a WHERE clause for sortkey and from
// pack( "H*", $foo ) is used to convert hex back to binary
- $escSortkey = $this->getDB()->addQuotes( pack( "H*", $cont[1] ) );
+ $escSortkey = $this->getDB()->addQuotes( pack( 'H*', $cont[1] ) );
$from = intval( $cont[2] );
$op = $dir == 'newer' ? '>' : '<';
// $contWhere is used further down
}
$start = $skip ? $fromTimestamp : $params['start'];
- $pageId = $pageIds[NS_FILE][ $img->getTitle()->getDBkey() ];
+ $pageId = $pageIds[NS_FILE][$img->getTitle()->getDBkey()];
$fit = $result->addValue(
array( 'query', 'pages', intval( $pageId ) ),
}
// The token is always the same, let's exploit that
- if ( !isset( ApiQueryInfo::$cachedTokens[ 'edit' ] ) ) {
- ApiQueryInfo::$cachedTokens[ 'edit' ] = $wgUser->getEditToken();
+ if ( !isset( ApiQueryInfo::$cachedTokens['edit'] ) ) {
+ ApiQueryInfo::$cachedTokens['edit'] = $wgUser->getEditToken();
}
- return ApiQueryInfo::$cachedTokens[ 'edit' ];
+ return ApiQueryInfo::$cachedTokens['edit'];
}
public static function getDeleteToken( $pageid, $title ) {
}
// The token is always the same, let's exploit that
- if ( !isset( ApiQueryInfo::$cachedTokens[ 'delete' ] ) ) {
- ApiQueryInfo::$cachedTokens[ 'delete' ] = $wgUser->getEditToken();
+ if ( !isset( ApiQueryInfo::$cachedTokens['delete'] ) ) {
+ ApiQueryInfo::$cachedTokens['delete'] = $wgUser->getEditToken();
}
- return ApiQueryInfo::$cachedTokens[ 'delete' ];
+ return ApiQueryInfo::$cachedTokens['delete'];
}
public static function getProtectToken( $pageid, $title ) {
}
// The token is always the same, let's exploit that
- if ( !isset( ApiQueryInfo::$cachedTokens[ 'protect' ] ) ) {
- ApiQueryInfo::$cachedTokens[ 'protect' ] = $wgUser->getEditToken();
+ if ( !isset( ApiQueryInfo::$cachedTokens['protect'] ) ) {
+ ApiQueryInfo::$cachedTokens['protect'] = $wgUser->getEditToken();
}
- return ApiQueryInfo::$cachedTokens[ 'protect' ];
+ return ApiQueryInfo::$cachedTokens['protect'];
}
public static function getMoveToken( $pageid, $title ) {
}
// The token is always the same, let's exploit that
- if ( !isset( ApiQueryInfo::$cachedTokens[ 'move' ] ) ) {
- ApiQueryInfo::$cachedTokens[ 'move' ] = $wgUser->getEditToken();
+ if ( !isset( ApiQueryInfo::$cachedTokens['move'] ) ) {
+ ApiQueryInfo::$cachedTokens['move'] = $wgUser->getEditToken();
}
- return ApiQueryInfo::$cachedTokens[ 'move' ];
+ return ApiQueryInfo::$cachedTokens['move'];
}
public static function getBlockToken( $pageid, $title ) {
}
// The token is always the same, let's exploit that
- if ( !isset( ApiQueryInfo::$cachedTokens[ 'block' ] ) ) {
- ApiQueryInfo::$cachedTokens[ 'block' ] = $wgUser->getEditToken();
+ if ( !isset( ApiQueryInfo::$cachedTokens['block'] ) ) {
+ ApiQueryInfo::$cachedTokens['block'] = $wgUser->getEditToken();
}
- return ApiQueryInfo::$cachedTokens[ 'block' ];
+ return ApiQueryInfo::$cachedTokens['block'];
}
public static function getUnblockToken( $pageid, $title ) {
}
// The token is always the same, let's exploit that
- if ( !isset( ApiQueryInfo::$cachedTokens[ 'email' ] ) ) {
- ApiQueryInfo::$cachedTokens[ 'email' ] = $wgUser->getEditToken();
+ if ( !isset( ApiQueryInfo::$cachedTokens['email'] ) ) {
+ ApiQueryInfo::$cachedTokens['email'] = $wgUser->getEditToken();
}
- return ApiQueryInfo::$cachedTokens[ 'email' ];
+ return ApiQueryInfo::$cachedTokens['email'];
}
public static function getImportToken( $pageid, $title ) {
}
// The token is always the same, let's exploit that
- if ( !isset( ApiQueryInfo::$cachedTokens[ 'import' ] ) ) {
- ApiQueryInfo::$cachedTokens[ 'import' ] = $wgUser->getEditToken();
+ if ( !isset( ApiQueryInfo::$cachedTokens['import'] ) ) {
+ ApiQueryInfo::$cachedTokens['import'] = $wgUser->getEditToken();
}
- return ApiQueryInfo::$cachedTokens[ 'import' ];
+ return ApiQueryInfo::$cachedTokens['import'];
}
public static function getWatchToken( $pageid, $title ) {
}
// The token is always the same, let's exploit that
- if ( !isset( ApiQueryInfo::$cachedTokens[ 'watch' ] ) ) {
- ApiQueryInfo::$cachedTokens[ 'watch' ] = $wgUser->getEditToken( 'watch' );
+ if ( !isset( ApiQueryInfo::$cachedTokens['watch'] ) ) {
+ ApiQueryInfo::$cachedTokens['watch'] = $wgUser->getEditToken( 'watch' );
}
- return ApiQueryInfo::$cachedTokens[ 'watch' ];
+ return ApiQueryInfo::$cachedTokens['watch'];
}
public static function getOptionsToken( $pageid, $title ) {
}
// The token is always the same, let's exploit that
- if ( !isset( ApiQueryInfo::$cachedTokens[ 'options' ] ) ) {
- ApiQueryInfo::$cachedTokens[ 'options' ] = $wgUser->getEditToken();
+ if ( !isset( ApiQueryInfo::$cachedTokens['options'] ) ) {
+ ApiQueryInfo::$cachedTokens['options'] = $wgUser->getEditToken();
}
- return ApiQueryInfo::$cachedTokens[ 'options' ];
+ return ApiQueryInfo::$cachedTokens['options'];
}
public function execute() {
$pageInfo['touched'] = wfTimestamp( TS_ISO_8601, $this->pageTouched[$pageid] );
$pageInfo['lastrevid'] = intval( $this->pageLatest[$pageid] );
$pageInfo['counter'] = $wgDisableCounters
- ? ""
+ ? ''
: intval( $this->pageCounter[$pageid] );
$pageInfo['length'] = intval( $this->pageLength[$pageid] );
'user' => array( 'JOIN',
'user_id=log_user' ),
'page' => array( 'LEFT JOIN',
- array( 'log_namespace=page_namespace',
+ array( 'log_namespace=page_namespace',
'log_title=page_title' ) ) ) );
$index = array( 'logging' => 'times' ); // default, may change
$noredirKey = '5::noredir';
}
- if ( isset( $params[ $targetKey ] ) ) {
- $title = Title::newFromText( $params[ $targetKey ] );
+ if ( isset( $params[$targetKey] ) ) {
+ $title = Title::newFromText( $params[$targetKey] );
if ( $title ) {
$vals2 = array();
ApiQueryBase::addTitleInfo( $vals2, $title, 'new_' );
$vals[$type] = $vals2;
}
}
- if ( isset( $params[ $noredirKey ] ) && $params[ $noredirKey ] ) {
+ if ( isset( $params[$noredirKey] ) && $params[$noredirKey] ) {
$vals[$type]['suppressedredirect'] = '';
}
$params = null;
}
}
if ( isset( $prop['hasrelated'] ) && $result->hasRelated() ) {
- $vals['hasrelated'] = "";
+ $vals['hasrelated'] = '';
}
// Add item to results and see whether it fits
$this->addWhereFld( 'user_name', $goodNames );
$this->addTables( 'user_groups' );
$this->addJoinConds( array( 'user_groups' => array( 'INNER JOIN', 'ug_user=user_id' ) ) );
- $this->addFields( array('user_name', 'ug_group') );
+ $this->addFields( array( 'user_name', 'ug_group' ) );
$userGroupsRes = $this->select( __METHOD__ );
foreach( $userGroupsRes as $row ) {
) );
$userId = $user->getId();
- $this->addJoinConds( array( 'watchlist' => array('INNER JOIN',
+ $this->addJoinConds( array( 'watchlist' => array( 'INNER JOIN',
array(
'wl_user' => $userId,
'wl_namespace=rc_namespace',