X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=blobdiff_plain;f=includes%2FTitle.php;h=481f480c995d91671b9e90634bf0a7cbeff3487b;hb=0d22edd27be1b912d8a7da4a2180044189f23475;hp=cf428f918b64e7c97a633effdae4d0a5e12cb194;hpb=d7f7a6234b36a3ab64df46ff46319f22d9f9ff1a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Title.php b/includes/Title.php index cf428f918b..481f480c99 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -209,7 +209,15 @@ class Title { */ public static function newFromID( $id, $flags = 0 ) { $db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); - $row = $db->selectRow( 'page', '*', array( 'page_id' => $id ), __METHOD__ ); + $row = $db->selectRow( + 'page', + array( + 'page_namespace', 'page_title', 'page_id', + 'page_len', 'page_is_redirect', 'page_latest', + ), + array( 'page_id' => $id ), + __METHOD__ + ); if ( $row !== false ) { $title = Title::newFromRow( $row ); } else { @@ -3489,12 +3497,7 @@ class Title { $protected = $this->isProtected(); // Do the actual move - $err = $this->moveToInternal( $nt, $reason, $createRedirect ); - if ( is_array( $err ) ) { - # @todo FIXME: What about the File we have already moved? - $dbw->rollback( __METHOD__ ); - return $err; - } + $this->moveToInternal( $nt, $reason, $createRedirect ); // Refresh the sortkey for this row. Be careful to avoid resetting // cl_timestamp, which may disturb time-based lists on some sites. @@ -3570,6 +3573,7 @@ class Title { * @param $reason String The reason for the move * @param $createRedirect Bool Whether to leave a redirect at the old title. Ignored * if the user doesn't have the suppressredirect right + * @throws MWException */ private function moveToInternal( &$nt, $reason = '', $createRedirect = true ) { global $wgUser, $wgContLang; @@ -3974,7 +3978,7 @@ class Title { $pageId = $this->getArticleID( $flags ); if ( $pageId ) { $db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); - $row = $db->selectRow( 'revision', '*', + $row = $db->selectRow( 'revision', Revision::selectFields(), array( 'rev_page' => $pageId ), __METHOD__, array( 'ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 1 )