From: Antoine Musso Date: Thu, 25 Nov 2010 20:01:34 +0000 (+0000) Subject: revert r76464 X-Git-Tag: 1.31.0-rc.0~33734 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=6fe29c9c30f2a90e389e8287c79d86d7c3708c9a;p=lhc%2Fweb%2Fwiklou.git revert r76464 * mixed style changes and variable removing * logic changes * useful comments removed --- diff --git a/includes/Article.php b/includes/Article.php index 7a99bef3a9..f82b141ce9 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1473,6 +1473,7 @@ class Article { global $wgOut; $oldid = $this->getOldID(); + $useParserCache = $this->useParserCache( $oldid ); $parserOptions = $this->getParserOptions(); # Render printable version, use printable version cache diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 5de3b06d41..a75ff2fcac 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -1055,7 +1055,7 @@ class EnhancedChangesList extends ChangesList { # 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 variables. - // TODO implement + $classes = array(); // TODO implement extract( $rcObj->mAttribs ); $query['curid'] = $rc_cur_id; diff --git a/includes/ConfEditor.php b/includes/ConfEditor.php index f240628e15..d62a9ceb1b 100644 --- a/includes/ConfEditor.php +++ b/includes/ConfEditor.php @@ -536,7 +536,7 @@ class ConfEditor { switch ( $state ) { case 'file': - $this->expect( T_OPEN_TAG ); + $token = $this->expect( T_OPEN_TAG ); $token = $this->skipSpace(); if ( $token->isEnd() ) { break 2; diff --git a/includes/EditPage.php b/includes/EditPage.php index 1182ef7995..b878c6d20a 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2232,9 +2232,7 @@ HTML $script = ''; foreach ( $toolarray as $tool ) { - if ( !$tool ) { - continue; - } + if ( !$tool ) continue; $params = array( $image = $wgStylePath . '/common/images/' . $tool['image'], diff --git a/includes/HistoryPage.php b/includes/HistoryPage.php index 88a8ee44fd..d45d08ce4f 100644 --- a/includes/HistoryPage.php +++ b/includes/HistoryPage.php @@ -538,9 +538,7 @@ class HistoryPager extends ReverseChronologicalPager { $rev->isDeleted( Revision::DELETED_RESTRICTED ), false ); } } - if ( $del ) { - $s .= " $del "; - } + if( $del ) $s .= " $del "; $s .= " $link"; $s .= " " . diff --git a/includes/ImagePage.php b/includes/ImagePage.php index a1b204fbd6..24999eb6db 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -331,6 +331,8 @@ class ImagePage extends Article { $height_orig = $this->displayImg->getHeight( $page ); $height = $height_orig; + $showLink = false; + $linkAttribs = array( 'href' => $full_url ); $longDesc = $this->displayImg->getLongDesc(); wfRunHooks( 'ImageOpenShowImageInlineBefore', array( &$this, &$wgOut ) ); @@ -1009,7 +1011,6 @@ class ImageHistoryList { } $row .= ''; - $rowClass = null; wfRunHooks( 'ImagePageFileHistoryLine', array( $this, $file, &$row, &$rowClass ) ); $classAttr = $rowClass ? " class='$rowClass'" : ""; diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php index 16ff100bc5..7d7fedd06a 100644 --- a/includes/MimeMagic.php +++ b/includes/MimeMagic.php @@ -826,7 +826,7 @@ class MimeMagic { $m = trim( $m ); $m = strtolower( $m ); - if ( strpos( $m, 'unknown' ) === false ) { + if ( strpos( $m, 'unknown' ) !== false ) { $m = null; } else { wfDebug( __METHOD__.": magic mime type of $file: $m\n" ); diff --git a/includes/OutputPage.php b/includes/OutputPage.php index a80d4eb89c..3740952114 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -563,6 +563,11 @@ class OutputPage { $nameWithTags = Sanitizer::normalizeCharReferences( Sanitizer::removeHTMLtags( $name ) ); $this->mPagetitle = $nameWithTags; + $taction = $this->getPageTitleActionText(); + if( !empty( $taction ) ) { + $name .= ' - '.$taction; + } + # change "foo&bar" to "foo&bar" $this->setHTMLTitle( wfMsg( 'pagetitle', Sanitizer::stripAllTags( $nameWithTags ) ) ); } diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 1a713fdc88..bd794c73c9 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -358,6 +358,7 @@ class SkinTemplate extends Skin { 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() ), diff --git a/includes/Title.php b/includes/Title.php index 13ea7d909c..5b90cfeb93 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3302,6 +3302,7 @@ class Title { # Truncate for whole multibyte characters. +5 bytes for ellipsis $comment = $wgContLang->truncate( $comment, 250 ); + $newid = $nt->getArticleID(); $oldid = $this->getArticleID(); $latest = $this->getLatestRevId(); diff --git a/includes/WatchlistEditor.php b/includes/WatchlistEditor.php index dda1b4a169..8850d26053 100644 --- a/includes/WatchlistEditor.php +++ b/includes/WatchlistEditor.php @@ -347,8 +347,7 @@ class WatchlistEditor { */ private function showNormalForm( $output, $user ) { global $wgUser; - $count = $this->showItemCount( $output, $user ); - if( $count > 0 ) { + if( ( $count = $this->showItemCount( $output, $user ) ) > 0 ) { $self = SpecialPage::getTitleFor( 'Watchlist' ); $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $self->getLocalUrl( array( 'action' => 'edit' ) ) ) ); diff --git a/includes/db/DatabaseIbm_db2.php b/includes/db/DatabaseIbm_db2.php index a3a6829b77..5d795862e0 100644 --- a/includes/db/DatabaseIbm_db2.php +++ b/includes/db/DatabaseIbm_db2.php @@ -1249,9 +1249,11 @@ EOF; $join_conds ); // We must adjust for offset - if ( isset( $options['LIMIT'] ) && isset ( $options['OFFSET'] ) ) { - $limit = $options['LIMIT']; - $offset = $options['OFFSET']; + if ( isset( $options['LIMIT'] ) ) { + if ( isset ( $options['OFFSET'] ) ) { + $limit = $options['LIMIT']; + $offset = $options['OFFSET']; + } } // DB2 does not have a proper num_rows() function yet, so we must emulate diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php index 93c1cf2c6f..a1b0a30e04 100644 --- a/includes/db/DatabaseMssql.php +++ b/includes/db/DatabaseMssql.php @@ -552,9 +552,9 @@ class DatabaseMssql extends DatabaseBase { */ function nextSequenceValue( $seqName ) { if ( !$this->tableExists( 'sequence_' . $seqName ) ) { - sqlsrv_query( $this->mConn, "CREATE TABLE [sequence_$seqName] (id INT NOT NULL IDENTITY PRIMARY KEY, junk varchar(10) NULL)" ); + $ret = sqlsrv_query( $this->mConn, "CREATE TABLE [sequence_$seqName] (id INT NOT NULL IDENTITY PRIMARY KEY, junk varchar(10) NULL)" ); } - sqlsrv_query( $this->mConn, "INSERT INTO [sequence_$seqName] (junk) VALUES ('')" ); + $ret = sqlsrv_query( $this->mConn, "INSERT INTO [sequence_$seqName] (junk) VALUES ('')" ); $ret = sqlsrv_query( $this->mConn, "SELECT TOP 1 id FROM [sequence_$seqName] ORDER BY id DESC" ); $row = sqlsrv_fetch_array( $ret, SQLSRV_FETCH_ASSOC );// KEEP ASSOC THERE, weird weird bug dealing with the return value if you don't diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index ecf67de2a3..79816c2081 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -751,6 +751,7 @@ class DatabasePostgres extends DatabaseBase { return true; } return false; + } /** diff --git a/includes/diff/WikiDiff.php b/includes/diff/WikiDiff.php index 47605506d0..c148d23853 100644 --- a/includes/diff/WikiDiff.php +++ b/includes/diff/WikiDiff.php @@ -313,7 +313,7 @@ class _DiffEngine { } $matches = $ymatches[$line]; reset($matches); - while ( list( , $y ) = each( $matches ) ) { + while ( list( $junk, $y ) = each( $matches ) ) { if ( empty( $this->in_seq[$y] ) ) { $k = $this->_lcs_pos( $y ); assert( $k > 0 ); @@ -321,7 +321,7 @@ class _DiffEngine { break; } } - while (list ( , $y) = each($matches)) { + while (list ( /* $junk */, $y) = each($matches)) { if ($y > $this->seq[$k-1]) { assert($y < $this->seq[$k]); // Optimization: this is a common case: diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php index 26cf53c316..1bf498f34d 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -395,6 +395,7 @@ abstract class DatabaseInstaller { * Set this to false to show a creation checkbox. */ public function getWebUserBox( $noCreateMsg = false ) { + $name = $this->getName(); $s = Html::openElement( 'fieldset' ) . Html::element( 'legend', array(), wfMsg( 'config-db-web-account' ) ) . $this->getCheckBox( diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 033875a298..12d02c544c 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -366,7 +366,7 @@ class MysqlInstaller extends DatabaseInstaller { if ( !$create ) { // Test the web account try { - new Database( + $webConn = new Database( $this->getVar( 'wgDBserver' ), $this->getVar( 'wgDBuser' ), $this->getVar( 'wgDBpassword' ), diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index 50376a5ca4..911a7d2a01 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -355,7 +355,7 @@ class MysqlUpdater extends DatabaseUpdater { $prev_namespace = $row->cur_namespace; } $sql = "DELETE FROM $cur WHERE cur_id IN ( " . join( ',', $deleteId ) . ')'; - $this->db->query( $sql, __METHOD__ ); + $rows = $this->db->query( $sql, __METHOD__ ); $this->output( wfTimestamp( TS_DB ) ); $this->output( "......Deleted " . $this->db->affectedRows() . " records.\n" ); } diff --git a/includes/installer/OracleInstaller.php b/includes/installer/OracleInstaller.php index 19c64e17d9..8dbc7ad3e5 100644 --- a/includes/installer/OracleInstaller.php +++ b/includes/installer/OracleInstaller.php @@ -39,6 +39,7 @@ class OracleInstaller extends DatabaseInstaller { } public function getWebUserBox( $noCreateMsg = false ) { + $name = $this->getName(); $this->parent->setVar( '_SameAccount', false ); $this->parent->setVar( '_CreateDBAccount', true ); $this->parent->setVar( 'wgDBname', '' ); diff --git a/includes/media/SVG.php b/includes/media/SVG.php index 899429cc9e..6c2d98059a 100644 --- a/includes/media/SVG.php +++ b/includes/media/SVG.php @@ -150,6 +150,7 @@ class SvgHandler extends ImageHandler { } function getMetadata( $file, $filename ) { + $metadata = array(); try { $metadata = SVGMetadataExtractor::getMetadata( $filename ); } catch( Exception $e ) { diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index d9ec72be83..f879a65f09 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -159,6 +159,7 @@ class LinkHolderArray { $current = null; foreach ( $this->internals as $ns => $entries ) { foreach ( $entries as $index => $entry ) { + $key = "$ns:$index"; $title = $entry['title']; $pdbk = $entry['pdbk']; diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index ae5e89199c..336bdea6ab 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -789,6 +789,7 @@ class Parser { 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) diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index 2b635f7c0d..991f28cc42 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -511,7 +511,9 @@ class Preprocessor_DOM implements Preprocessor { // 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 ); @@ -534,7 +536,9 @@ class Preprocessor_DOM implements Preprocessor { $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; @@ -957,9 +961,7 @@ class PPFrame_DOM implements PPFrame { $iteratorStack[$level] = false; } - if ( $contextNode instanceof PPNode_DOM ) { - $contextNode = $contextNode->node; - } + if ( $contextNode instanceof PPNode_DOM ) $contextNode = $contextNode->node; $newIterator = false; diff --git a/includes/specials/SpecialComparePages.php b/includes/specials/SpecialComparePages.php index 4650fc9458..8f7d024307 100644 --- a/includes/specials/SpecialComparePages.php +++ b/includes/specials/SpecialComparePages.php @@ -97,6 +97,7 @@ class SpecialComparePages extends SpecialPage { $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' ), diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 2a0c9efd47..b922c6fd9d 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -342,9 +342,9 @@ class SpecialSearch { 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 ) { @@ -416,6 +416,7 @@ class SpecialSearch { if( !is_null($infoLine) ) { $out .= "\n\n"; } + $off = $this->offset + 1; $out .= "