* Callback for preg_replace_callback() call in makeHelpMsg().
* Replaces a source file name with a link to ViewVC
*
+ * @param $matches array
* @return string
*/
public function makeHelpMsg_callback( $matches ) {
$params = $this->extractRequestParams();
if ( $params['gettoken'] ) {
- $res['blocktoken'] = $user->editToken( '', $this->getMain()->getRequest() );
+ $res['blocktoken'] = $user->getEditToken( '', $this->getMain()->getRequest() );
$this->getResult()->addValue( null, $this->getModuleName(), $res );
return;
}
}
/**
- *
- * @param &$title Title
+ * @param $title Title
* @param $token String
+ * @return array
*/
private static function getPermissionsError( &$title, $token ) {
global $wgUser;
// Check permissions
- $errors = $title->getUserPermissionsErrors( 'delete', $wgUser );
- if ( count( $errors ) > 0 ) {
- return $errors;
- }
-
- return array();
+ return $title->getUserPermissionsErrors( 'delete', $wgUser );
}
/**
<?php
-
/**
*
*
public function getVersion() {
return __CLASS__ . ': $Id$';
}
-}
\ No newline at end of file
+}
}
}
+ /**
+ * @param $info array
+ * @return FeedItem
+ */
private function createFeedItem( $info ) {
$titleStr = $info['title'];
$title = Title::newFromText( $titleStr );
public function getBuffer() {
return $this->mBuffer;
}
+
/**
* Set the flag to buffer the result instead of printing it.
+ * @param $value bool
*/
public function setBufferResult( $value ) {
$this->mBufferResult = $value;
/**
* Feed does its own headers
+ *
+ * @return null
*/
public function getMimeType() {
return null;
/**
* @deprecated since 1.18 No modern skin generates language links this way, please use language links
* data to generate your own HTML.
+ * @param $languages array
+ * @return string
*/
private function languagesHtml( $languages ) {
global $wgContLang, $wgHideInterlanguageLinks;
if ( $fld_token ) {
// Undelete tokens are identical for all pages, so we cache one here
- $token = $user->editToken( '', $this->getMain()->getRequest() );
+ $token = $user->getEditToken( '', $this->getMain()->getRequest() );
}
$dir = $params['dir'];
return $cachedEditToken;
}
- $cachedEditToken = $wgUser->editToken();
+ $cachedEditToken = $wgUser->getEditToken();
return $cachedEditToken;
}
return $cachedDeleteToken;
}
- $cachedDeleteToken = $wgUser->editToken();
+ $cachedDeleteToken = $wgUser->getEditToken();
return $cachedDeleteToken;
}
return $cachedProtectToken;
}
- $cachedProtectToken = $wgUser->editToken();
+ $cachedProtectToken = $wgUser->getEditToken();
return $cachedProtectToken;
}
return $cachedMoveToken;
}
- $cachedMoveToken = $wgUser->editToken();
+ $cachedMoveToken = $wgUser->getEditToken();
return $cachedMoveToken;
}
return $cachedBlockToken;
}
- $cachedBlockToken = $wgUser->editToken();
+ $cachedBlockToken = $wgUser->getEditToken();
return $cachedBlockToken;
}
return $cachedEmailToken;
}
- $cachedEmailToken = $wgUser->editToken();
+ $cachedEmailToken = $wgUser->getEditToken();
return $cachedEmailToken;
}
return $cachedImportToken;
}
- $cachedImportToken = $wgUser->editToken();
+ $cachedImportToken = $wgUser->getEditToken();
return $cachedImportToken;
}
return $cachedWatchToken;
}
- $cachedWatchToken = $wgUser->editToken( 'watch' );
+ $cachedWatchToken = $wgUser->getEditToken( 'watch' );
return $cachedWatchToken;
}
* Get an array mapping token names to their handler functions.
* The prototype for a token function is func($pageid, $title, $rc)
* it should return a token or false (permission denied)
- * @return array(tokenname => function)
+ * @return array array(tokenname => function)
*/
protected function getTokenFunctions() {
// Don't call the hooks twice
// The patrol token is always the same, let's exploit that
static $cachedPatrolToken = null;
if ( is_null( $cachedPatrolToken ) ) {
- $cachedPatrolToken = $wgUser->editToken( 'patrol' );
+ $cachedPatrolToken = $wgUser->getEditToken( 'patrol' );
}
return $cachedPatrolToken;
if ( !$wgUser->isAllowed( 'rollback' ) ) {
return false;
}
- return $wgUser->editToken( array( $title->getPrefixedText(),
- $rev->getUserText() ) );
+ return $wgUser->getEditToken(
+ array( $title->getPrefixedText(), $rev->getUserText() ) );
}
public function execute() {
if ( isset( $this->prop['preferencestoken'] ) &&
is_null( $this->getMain()->getRequest()->getVal( 'callback' ) )
) {
- $vals['preferencestoken'] = $user->editToken( '', $this->getMain()->getRequest() );
+ $vals['preferencestoken'] = $user->getEditToken( '', $this->getMain()->getRequest() );
}
if ( isset( $this->prop['editcount'] ) ) {
global $wgUser;
// Since the permissions check for userrights is non-trivial,
// don't bother with it here
- return $wgUser->editToken( $user->getName() );
+ return $wgUser->getEditToken( $user->getName() );
}
public function execute() {
$params = $this->extractRequestParams();
if ( $params['gettoken'] ) {
- $res['unblocktoken'] = $user->editToken( '', $this->getMain()->getRequest() );
+ $res['unblocktoken'] = $user->getEditToken( '', $this->getMain()->getRequest() );
$this->getResult()->addValue( null, $this->getModuleName(), $res );
return;
}