X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FRevision.php;h=05a4a68ade5ead3f15226a5544716740823753b0;hb=1e7e73444a9357be1c58301e8707c029f31f5ef7;hp=7223fcc6dc4023746bd8d0e8c88c81102f329a75;hpb=63823a6879564554a56a49d37a3f394b023c492e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Revision.php b/includes/Revision.php index 7223fcc6dc..05a4a68ade 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -10,8 +10,8 @@ class Revision { const DELETED_TEXT = 1; const DELETED_COMMENT = 2; const DELETED_USER = 4; - const DELETED_RESTRICTED = 8; - + const DELETED_RESTRICTED = 8; + /** * Load a page revision from a given revision ID number. * Returns null if no such revision can be found. @@ -47,7 +47,7 @@ class Revision { array( "rev_id=$matchId", 'page_id=rev_page', 'page_namespace' => $title->getNamespace(), - 'page_title' => $title->getDbkey() ) ); + 'page_title' => $title->getDBkey() ) ); } /** @@ -110,7 +110,7 @@ class Revision { array( "rev_id=$matchId", 'page_id=rev_page', 'page_namespace' => $title->getNamespace(), - 'page_title' => $title->getDbkey() ) ); + 'page_title' => $title->getDBkey() ) ); } /** @@ -131,7 +131,7 @@ class Revision { array( 'rev_timestamp' => $db->timestamp( $timestamp ), 'page_id=rev_page', 'page_namespace' => $title->getNamespace(), - 'page_title' => $title->getDbkey() ) ); + 'page_title' => $title->getDBkey() ) ); } /** @@ -190,7 +190,7 @@ class Revision { return Revision::fetchFromConds( wfGetDB( DB_SLAVE ), array( 'page_namespace' => $title->getNamespace(), - 'page_title' => $title->getDbkey(), + 'page_title' => $title->getDBkey(), 'page_id=rev_page' ) ); } @@ -209,7 +209,7 @@ class Revision { wfGetDB( DB_SLAVE ), array( 'rev_id=page_latest', 'page_namespace' => $title->getNamespace(), - 'page_title' => $title->getDbkey(), + 'page_title' => $title->getDBkey(), 'page_id=rev_page' ) ); } @@ -281,8 +281,8 @@ class Revision { $this->mMinorEdit = intval( $row->rev_minor_edit ); $this->mTimestamp = $row->rev_timestamp; $this->mDeleted = intval( $row->rev_deleted ); - - if( is_null( $row->rev_len ) ) + + if( !isset( $row->rev_len ) || is_null( $row->rev_len ) ) $this->mSize = null; else $this->mSize = intval( $row->rev_len ); @@ -611,7 +611,7 @@ class Revision { # Old revisions kept around in a legacy encoding? # Upconvert on demand. global $wgInputEncoding, $wgContLang; - $text = $wgContLang->iconv( $wgLegacyEncoding, $wgInputEncoding . '//IGNORE', $text ); + $text = $wgContLang->iconv( $wgLegacyEncoding, $wgInputEncoding, $text ); } } wfProfileOut( $fname ); @@ -794,9 +794,8 @@ class Revision { * @param bool $minor * @return Revision */ - function newNullRevision( &$dbw, $pageId, $summary, $minor ) { - $fname = 'Revision::newNullRevision'; - wfProfileIn( $fname ); + public static function newNullRevision( &$dbw, $pageId, $summary, $minor ) { + wfProfileIn( __METHOD__ ); $current = $dbw->selectRow( array( 'page', 'revision' ), @@ -805,7 +804,7 @@ class Revision { 'page_id' => $pageId, 'page_latest=rev_id', ), - $fname ); + __METHOD__ ); if( $current ) { $revision = new Revision( array( @@ -818,7 +817,7 @@ class Revision { $revision = null; } - wfProfileOut( $fname ); + wfProfileOut( __METHOD__ ); return $revision; } @@ -888,4 +887,4 @@ define( 'MW_REV_DELETED_USER', Revision::DELETED_USER ); define( 'MW_REV_DELETED_RESTRICTED', Revision::DELETED_RESTRICTED ); -?> +