* Specify USE INDEX on Allpages chunk queries, sometimes gets lost
due to bogus optimization
* (bug 275) Section duplication fix
+* Remove unused use of undefined variable in UserMailer
+* Fix notice on search index update due to non-array
+* (bug 2885) Fix fatal errors and notices in PHP 5.1.0beta3
+* (bug 2931) Fix additional notices on reference use in PHP 4.4.0
=== Caveats ===
*/
function &getDB() {
#if ( $this->mForUpdate ) {
- return wfGetDB( DB_MASTER );
+ $ret =& wfGetDB( DB_MASTER );
#} else {
- # return wfGetDB( DB_SLAVE );
+ # $ret =& wfGetDB( DB_SLAVE );
#}
+ return $ret;
}
/**
* @param string $serial
* @return mixed
*/
- function &_unserialize( $serial ) {
+ function _unserialize( $serial ) {
if( function_exists( 'gzinflate' ) ) {
$decomp = @gzinflate( $serial );
if( false !== $decomp ) {
* @return string
*/
function makeUpdateOptions( $options ) {
+ if( !is_array( $options ) ) {
+ wfDebugDieBacktrace( 'makeUpdateOptions given non-array' );
+ }
$opts = array();
if ( in_array( 'LOW_PRIORITY', $options ) )
$opts[] = $this->lowPriorityOption();
/**
* @todo document
*/
- function &resultObject( &$result ) {
+ function resultObject( &$result ) {
if( empty( $result ) ) {
return NULL;
} else {
/**
* @todo document
*/
- function &fetchObject() {
+ function fetchObject() {
return $this->db->fetchObject( $this->result );
}
*/
function &wfGetDB( $db = DB_LAST, $groups = array() ) {
global $wgLoadBalancer;
- return $wgLoadBalancer->getConnection( $db, true, $groups );
+ $ret =& $wgLoadBalancer->getConnection( $db, true, $groups );
+ return $ret;
}
/**
$dbr =& wfGetDB( DB_SLAVE );
if( $this->mNewid ) {
- $this->newRev =& Revision::newFromId( $this->mNewid );
+ $this->newRev = Revision::newFromId( $this->mNewid );
} else {
- $this->newRev =& Revision::newFromTitle( $wgTitle );
+ $this->newRev = Revision::newFromTitle( $wgTitle );
}
if( is_null( $this->newRev ) ) {
return false;
}
if( $this->mOldid ) {
- $this->oldRev =& Revision::newFromId( $this->mOldid );
+ $this->oldRev = Revision::newFromId( $this->mOldid );
} else {
- $this->oldRev =& $this->newRev->getPrevious();
+ $this->oldRev = $this->newRev->getPrevious();
$this->mOldid = $this->oldRev->getId();
}
if( is_null( $this->oldRev ) ) {
/**
* Pass a title object, not a title string
*/
- function makeLinkObj( &$nt, $text= '', $query = '', $trail = '', $prefix = '' ) {
+ function makeLinkObj( $nt, $text= '', $query = '', $trail = '', $prefix = '' ) {
global $wgOut, $wgUser;
$fname = 'Linker::makeLinkObj';
wfProfileIn( $fname );
}
/** @todo document */
- function makeImageLinkObj( &$nt, $label, $alt, $align = '', $width = false, $height = false, $framed = false,
+ function makeImageLinkObj( $nt, $label, $alt, $align = '', $width = false, $height = false, $framed = false,
$thumb = false, $manual_thumb = '' )
{
global $wgContLang, $wgUser, $wgThumbLimits;
/**
* Pass a title object, not a title string
*/
- function makeBrokenImageLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
+ function makeBrokenImageLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
# Fail gracefully
if ( ! isset($nt) ) {
# wfDebugDieBacktrace();
/**
* Returns the canonical (English Wikipedia) name for a given index
*/
- function &getCanonicalName( $index ) {
+ function getCanonicalName( $index ) {
global $wgCanonicalNamespaceNames;
return $wgCanonicalNamespaceNames[$index];
}
* Returns the index for a given canonical name, or NULL
* The input *must* be converted to lower case first
*/
- function &getCanonicalIndex( $name ) {
+ function getCanonicalIndex( $name ) {
global $wgCanonicalNamespaceNames;
static $xNamespaces = false;
if ( $xNamespaces === false ) {
function &wfGetMainCache() {
global $wgMainCacheType;
- return wfGetCache( $wgMainCacheType );
+ $ret =& wfGetCache( $wgMainCacheType );
+ return $ret;
}
function &wfGetMessageCacheStorage() {
global $wgMessageCacheType;
- return wfGetCache( $wgMessageCacheType );
+ $ret =& wfGetCache( $wgMessageCacheType );
+ return $ret;
}
-function wfGetParserCacheStorage() {
+function &wfGetParserCacheStorage() {
global $wgParserCacheType;
- return wfGetCache( $wgParserCacheType );
+ $ret =& wfGetCache( $wgParserCacheType );
+ return $ret;
}
?>
function getUseDynamicDates() { return $this->mUseDynamicDates; }
function getInterwikiMagic() { return $this->mInterwikiMagic; }
function getAllowExternalImages() { return $this->mAllowExternalImages; }
- function getSkin() { return $this->mSkin; }
+ function &getSkin() { return $this->mSkin; }
function getDateFormat() { return $this->mDateFormat; }
function getEditSection() { return $this->mEditSection; }
function getNumberHeadings() { return $this->mNumberHeadings; }
* @static
* @access public
*/
- function &newFromId( $id ) {
+ function newFromId( $id ) {
return Revision::newFromConds(
array( 'page_id=rev_page',
'rev_id' => IntVal( $id ) ) );
* @access public
* @static
*/
- function &newFromTitle( &$title, $id = 0 ) {
+ function newFromTitle( &$title, $id = 0 ) {
if( $id ) {
$matchId = IntVal( $id );
} else {
* @return Revision
* @access public
*/
- function &loadFromPageId( &$db, $pageid, $id = 0 ) {
+ function loadFromPageId( &$db, $pageid, $id = 0 ) {
if( $id ) {
$matchId = IntVal( $id );
} else {
* @return Revision
* @access public
*/
- function &loadFromTitle( &$db, $title, $id = 0 ) {
+ function loadFromTitle( &$db, $title, $id = 0 ) {
if( $id ) {
$matchId = IntVal( $id );
} else {
* @access public
* @static
*/
- function &loadFromTimestamp( &$db, &$title, $timestamp ) {
+ function loadFromTimestamp( &$db, &$title, $timestamp ) {
return Revision::loadFromConds(
$db,
array( 'rev_timestamp' => $db->timestamp( $timestamp ),
* @static
* @access private
*/
- function &newFromConds( $conditions ) {
+ function newFromConds( $conditions ) {
$db =& wfGetDB( DB_SLAVE );
$row = Revision::loadFromConds( $db, $conditions );
if( is_null( $row ) ) {
* @static
* @access private
*/
- function &loadFromConds( &$db, $conditions ) {
- $res =& Revision::fetchFromConds( $db, $conditions );
+ function loadFromConds( &$db, $conditions ) {
+ $res = Revision::fetchFromConds( $db, $conditions );
if( $res ) {
$row = $res->fetchObject();
$res->free();
* @static
* @access public
*/
- function &fetchAllRevisions( &$title ) {
+ function fetchAllRevisions( &$title ) {
return Revision::fetchFromConds(
wfGetDB( DB_SLAVE ),
array( 'page_namespace' => $title->getNamespace(),
* @static
* @access public
*/
- function &fetchRevision( &$title ) {
+ function fetchRevision( &$title ) {
return Revision::fetchFromConds(
wfGetDB( DB_SLAVE ),
array( 'rev_id=page_latest',
* @static
* @access private
*/
- function &fetchFromConds( &$db, $conditions ) {
+ function fetchFromConds( &$db, $conditions ) {
$res = $db->select(
array( 'page', 'revision' ),
array( 'page_namespace',
* Returns the title of the page associated with this entry.
* @return Title
*/
- function &getTitle() {
+ function getTitle() {
if( isset( $this->mTitle ) ) {
return $this->mTitle;
}
'rev_id' => $this->mId ),
'Revision::getTItle' );
if( $row ) {
- $this->mTitle =& Title::makeTitle( $row->page_namespace,
+ $this->mTitle = Title::makeTitle( $row->page_namespace,
$row->page_title );
}
return $this->mTitle;
/**
* @return Revision
*/
- function &getPrevious() {
+ function getPrevious() {
$prev = $this->mTitle->getPreviousRevisionID( $this->mId );
return Revision::newFromTitle( $this->mTitle, $prev );
}
/**
* @return Revision
*/
- function &getNext() {
+ function getNext() {
$next = $this->mTitle->getNextRevisionID( $this->mId );
return Revision::newFromTitle( $this->mTitle, $next );
}
* @param bool $minor
* @return Revision
*/
- function &newNullRevision( &$dbw, $pageId, $summary, $minor ) {
+ function newNullRevision( &$dbw, $pageId, $summary, $minor ) {
$fname = 'Revision::newNullRevision';
wfProfileIn( $fname );
wfProfileIn( $fname );
require_once( 'SearchEngine.php' );
- $search =& SearchEngine::create();
+ $search = SearchEngine::create();
$lc = $search->legalSearchChars() . '&#;';
if( $this->mText === false ) {
* @return object
* @access private
*/
- function &setupTemplate( $classname, $repository=false, $cache_dir=false ) {
+ function setupTemplate( $classname, $repository=false, $cache_dir=false ) {
return new $classname();
}
$this->mTitle =& $wgTitle;
$this->mUser =& $wgUser;
- $tpl =& $this->setupTemplate( $this->template, 'skins' );
+ $tpl = $this->setupTemplate( $this->template, 'skins' );
#if ( $wgUseDatabaseMessages ) { // uncomment this to fall back to GetText
$tpl->setTranslator(new MediaWiki_I18N());
}
- function tabAction( &$title, $message, $selected, $query='', $checkEdit=false ) {
+ function tabAction( $title, $message, $selected, $query='', $checkEdit=false ) {
$classes = array();
if( $selected ) {
$classes[] = 'selected';