* @return Database
*/
function &getDB() {
- $ret =& wfGetDB( DB_MASTER );
- return $ret;
+ return wfGetDB( DB_MASTER );
}
/**
if( $protect )
$comment .= " [$updated]";
$nullRevision = Revision::newNullRevision( $dbw, $id, $comment, true );
- $nullRevId = $nullRevision->insertOn( $dbw );
+ $nullRevision->insertOn( $dbw );
# Update restrictions table
foreach( $limit as $action => $restrictions ) {
if ( !wfReadOnly() ) {
# Get templates from templatelinks
- $result = array();
$id = $this->mTitle->getArticleID();
$tlTemplates = array();
return $dbw->lastError();
}
function _maxdatetime() {
- $dbw =& wfGetDB(DB_MASTER);
if ( time() > 0x7fffffff ) {
return $this->_fromunixtime( 1<<62 );
} else {
wfProfileIn( $fname );
# Extract DB fields into local scope
+ // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables.
extract( $rc->mAttribs );
# Should patrol-related stuff be shown?
$rc = RCCacheEntry::newFromParent( $baseRC );
# Extract fields from DB into the function scope (rc_xxxx variables)
+ // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables.
extract( $rc->mAttribs );
$curIdEq = 'curid=' . $rc_cur_id;
$r .= '<div id="'.$rci.'" style="display:none">';
foreach( $block as $rcObj ) {
# Get rc_xxxx variables
+ // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables.
extract( $rcObj->mAttribs );
$r .= $this->spacerArrow();
global $wgContLang, $wgRCShowChangedSize;
# Get rc_xxxx variables
+ // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables.
extract( $rcObj->mAttribs );
$curIdEq = 'curid='.$rc_cur_id;
$cache = new HTMLFileCache( $t );
if( $cache->isFileCached() ) {
+ // FIXME: $msg is not defined on the next line.
$msg = '<p style="color: red"><b>'.$msg."<br />\n" .
$cachederror . "</b></p>\n";
}
function showDiffPage( $diffOnly = false ) {
- global $wgUser, $wgOut, $wgContLang, $wgUseExternalEditor, $wgUseRCPatrol;
+ global $wgUser, $wgOut, $wgUseExternalEditor, $wgUseRCPatrol;
$fname = 'DifferenceEngine::showDiffPage';
wfProfileIn( $fname );
function dump() {
$file = fopen( $this->mFilename, 'rb' );
$header = fread( $file, 12 );
+ // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables.
extract( unpack( 'a4magic/a4chunk/NchunkLength', $header ) );
echo "$chunk $chunkLength\n";
$this->dumpForm( $file, $chunkLength, 1 );
if( $chunkHeader == '' ) {
break;
}
+ // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables.
extract( unpack( 'a4chunk/NchunkLength', $chunkHeader ) );
echo str_repeat( ' ', $indent * 4 ) . "$chunk $chunkLength\n";
if( strlen( $header ) < 16 ) {
wfDebug( __METHOD__ . ": too short file header\n" );
} else {
+ // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables.
extract( unpack( 'a4magic/a4form/NformLength/a4subtype', $header ) );
if( $magic != 'AT&T' ) {
if( strlen( $header ) < 8 ) {
return array( false, 0 );
} else {
+ // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables.
extract( unpack( 'a4chunk/Nlength', $header ) );
return array( $chunk, $length );
}
return false;
}
+ // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables.
extract( unpack(
'nwidth/' .
'nheight/' .
return $addr;
// IPv6 loopback address
+ $m = array();
if ( preg_match( '/^0*' . RE_IPV6_GAP . '1$/', $addr, $m ) )
return '127.0.0.1';
}
$oldver = wfTimestampNow() . "!{$name}";
- $dbr =& wfGetDB( DB_SLAVE );
- $size = $dbr->selectField( 'oldimage', 'oi_size', array( 'oi_archive_name' => $oldimage ) );
-
if ( ! rename( $curfile, "${archive}/{$oldver}" ) ) {
$wgOut->showFileRenameError( $curfile, "${archive}/{$oldver}" );
return;
* @return string
*/
public static function formatBlockFlags( $flags ) {
- static $messages = false;
$flags = explode( ',', trim( $flags ) );
if( count( $flags ) > 0 ) {
for( $i = 0; $i < count( $flags ); $i++ )
* Loads all or main part of cacheable messages from the database
*/
function loadFromDB() {
- global $wgLang, $wgMaxMsgCacheEntrySize;
+ global $wgMaxMsgCacheEntrySize;
wfProfileIn( __METHOD__ );
$dbr =& wfGetDB( DB_SLAVE );
$match= array();
$prog= "";
- if (preg_match('%/?([^\s]+/)(w+)%sim',$head,$match)) $script= $match[2];
+ if (preg_match('%/?([^\s]+/)(w+)%sim',$head,$match)) {
+ $script= $match[2]; // FIXME: $script variable not used; should this be "$prog = $match[2];" instead?
+ }
$mime= "application/x-$prog";
}
function getIRCLine() {
global $wgUseRCPatrol;
+ // FIXME: Would be good to replace these 2 extract() calls with something more explicit
+ // e.g. list ($rc_type, $rc_id) = array_values ($this->mAttribs); [or something like that]
extract($this->mAttribs);
extract($this->mExtra);
* @return string
*/
function getUserJs() {
- $fname = 'Skin::getUserJs';
wfProfileIn( __METHOD__ );
global $wgStylePath;
/* these are used extensively in SkinTemplate, but also some other places */
static function makeMainPageUrl( $urlaction = '' ) {
$title = Title::newMainPage();
- self::checkTitle( $title, $name );
+ self::checkTitle( $title, '' );
return $title->getLocalURL( $urlaction );
}
}
# make sure we have some title to operate on
- static function checkTitle( &$title, &$name ) {
+ static function checkTitle( &$title, $name ) {
if( !is_object( $title ) ) {
$title = Title::newFromText( $name );
if( !is_object( $title ) ) {
* @param mixed $str
* @private
*/
- function printOrError( &$str ) {
+ function printOrError( $str ) {
echo $str;
}
# Editing
#
- global $wgLivePreview, $wgUseRCPatrol;
+ global $wgLivePreview;
$wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'textboxsize' ) . '</legend>
<div>' .
wfInputLabel( wfMsg( 'rows' ), 'wpRows', 'wpRows', 3, $this->mRows ) .
$out = wfMsgWikiHtml( 'allpagesbadtitle' );
} else {
list( $namespace, $prefixKey, $prefix ) = $prefixList;
- list( $fromNs, $fromKey, $from ) = $fromList;
+ list( /* $fromNs */, $fromKey, $from ) = $fromList;
### FIXME: should complain if $fromNs != $namespace
} else {
$finalExt = '';
}
- $fullExt = implode( '.', $ext );
# If there was more than one "extension", reassemble the base
# filename to prevent bogus complaints about length
$version = self::getVersion();
$dbr =& wfGetDB( DB_SLAVE );
- global $wgLanguageNames, $wgLanguageCode;
- $mwlang = $wgLanguageNames[$wgLanguageCode];
-
$ret =
"__NOTOC__
This wiki is powered by '''[http://www.mediawiki.org/ MediaWiki]''',
* @param $par Parameter passed to the page
*/
function wfSpecialWatchlist( $par ) {
- global $wgUser, $wgOut, $wgLang, $wgMemc, $wgRequest, $wgContLang;
+ global $wgUser, $wgOut, $wgLang, $wgRequest, $wgContLang;
global $wgRCShowWatchingUsers, $wgEnotifWatchlist, $wgShowUpdatedMarker;
global $wgEnotifWatchlist;
$fname = 'wfSpecialWatchlist';