if( $wgPageShowWatchingUsers ) {
$dbr = wfGetDB( DB_SLAVE );
- $watchlist = $dbr->tableName( 'watchlist' );
$res = $dbr->select( 'watchlist',
array( 'COUNT(*) AS n' ),
array( 'wl_title' => $dbr->strencode( $this->mTitle->getDBkey() ), 'wl_namespace' => $this->mTitle->getNamespace() ),
# Truncate for whole multibyte characters. +5 bytes for ellipsis
$comment = $wgContLang->truncate( $comment, 250 );
- $newid = $nt->getArticleID();
$oldid = $this->getArticleID();
$latest = $this->getLatestRevId();
wfProfileIn( __METHOD__ );
$lines = StringUtils::explode( "\n", $text );
- $text = null;
$out = '';
$td_history = array(); # Is currently a td tag open?
$last_tag_history = array(); # Save history of last lag activated (td, th or caption)
// another heading. Infinite loops are avoided because the next iteration MUST
// hit the heading open case above, which unconditionally increments the
// input pointer.
- }
-
- elseif ( $found == 'open' ) {
+ } elseif ( $found == 'open' ) {
# count opening brace characters
$count = strspn( $text, $curChar, $i );
$accum .= htmlspecialchars( str_repeat( $curChar, $count ) );
}
$i += $count;
- }
-
- elseif ( $found == 'close' ) {
+ } elseif ( $found == 'close' ) {
$piece = $stack->top;
# lets check if there are enough characters for closing brace
$maxCount = $piece->count;
$iteratorStack[$level] = false;
}
- if ( $contextNode instanceof PPNode_DOM ) $contextNode = $contextNode->node;
+ if ( $contextNode instanceof PPNode_DOM ) {
+ $contextNode = $contextNode->node;
+ }
$newIterator = false;
$this->form();
if( $this->opts->getValue( 'rev1' ) && $this->opts->getValue( 'rev2' ) ) {
- $title = Title::newFromText( $this->opts->getValue( 'page2' ) );
$de = new DifferenceEngine( null,
$this->opts->getValue( 'rev1' ),
$this->opts->getValue( 'rev2' ),
global $wgOut;
// Figure out the active search profile header
$nsAllSet = array_keys( SearchEngine::searchableNamespaces() );
- if( $this->searchAdvanced )
+ if( $this->searchAdvanced ) {
$this->active = 'advanced';
- else {
+ } else {
$profiles = $this->getSearchProfiles();
foreach( $profiles as $key => $data ) {
if( !is_null($infoLine) ) {
$out .= "\n<!-- {$infoLine} -->\n";
}
- $off = $this->offset + 1;
$out .= "<ul class='mw-search-results'>\n";
while( $result = $matches->next() ) {
$out .= $this->showHit( $result, $terms );
$out = "<div id='mw-search-interwiki'><div id='mw-search-interwiki-caption'>".
wfMsg('search-interwiki-caption')."</div>\n";
- $off = $this->offset + 1;
$out .= "<ul class='mw-search-iwresults'>\n";
// work out custom project captions
$wgOut->addWikiMsg( 'accmailtext', $u->getName(), $u->getEmail() );
$wgOut->returnToMain( false );
}
- $u = 0;
}
/**
}
wfDebug( __METHOD__ . ": creating account\n" );
- $user = $this->initUser( $user, true );
+ $this->initUser( $user, true );
return self::SUCCESS;
}
protected function verifyFile() {
# get the title, even though we are doing nothing with it, because
# we need to populate mFinalExtension
- $nt = $this->getTitle();
+ $this->getTitle();
$this->mFileProps = File::getPropsFromPath( $this->mTempPath, $this->mFinalExtension );
$this->checkMacBinary();
while ( true ) {
try {
$text = $this->getTextDb( $id );
- $ex = new MWException( "Graceful storage failure" );
} catch ( DBQueryError $ex ) {
$text = false;
}
$dbw = wfGetDB( DB_MASTER );
$page = $dbw->tableName( 'page' );
$revision = $dbw->tableName( 'revision' );
- $text = $dbw->tableName( 'text' );
if ( $fix ) {
$dbw->lockTables( $dbw, 'text', __METHOD__ );
$maxlag = intval( $maxlag );
$throttle = intval( $throttle );
- $force = (bool)$force;
if ( $begin !== '' ) {
$where = 'cl_to > ' . $dbw->addQuotes( $begin );
} else {
# Update recent changes if required
if ( $rc ) {
$this->output( "Updating recent changes..." );
- $res = $dbw->update( 'recentchanges', $this->userSpecification( $to, 'rc_user', 'rc_user_text' ), $this->userConditions( $from, 'rc_user', 'rc_user_text' ), __METHOD__ );
+ $dbw->update( 'recentchanges', $this->userSpecification( $to, 'rc_user', 'rc_user_text' ), $this->userConditions( $from, 'rc_user', 'rc_user_text' ), __METHOD__ );
$this->output( "done.\n" );
}
}
$this->assertTrue( $exception, "Got exception" );
self::$user->addGroup( 'sysop' );
- $exception = false;
$data = $this->doApiRequest( array(
'action' => 'upload',
'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png',
global $wgUser;
$wgUser = self::$users['uploader']->user;
- $extension = 'png';
$mimeType = 'image/png';
$filePath = tempnam( wfTempDir(), "" );
$hash = File::sha1Base36( $filePath );
$dupes = RepoGroup::singleton()->findBySha1( $hash );
$success = true;
- foreach ( $dupes as $key => $dupe ) {
+ foreach ( $dupes as $dupe ) {
$success &= $this->deleteFileByTitle( $dupe->getTitle() );
}
return $success;