Add a version number and user-agent string to ForeignAPIRepo.
[lhc/web/wiklou.git] / includes / Revision.php
index cbf5625..e2eed75 100644 (file)
@@ -290,7 +290,7 @@ class Revision {
         * @param $row Mixed: either a database row or an array
         * @access private
         */
-       function Revision( $row ) {
+       function __construct( $row ) {
                if( is_object( $row ) ) {
                        $this->mId        = intval( $row->rev_id );
                        $this->mPage      = intval( $row->rev_page );
@@ -314,8 +314,7 @@ class Revision {
 
                        if( isset( $row->page_latest ) ) {
                                $this->mCurrent = ( $row->rev_id == $row->page_latest );
-                               $this->mTitle = Title::makeTitle( $row->page_namespace, $row->page_title );
-                               $this->mTitle->resetArticleID( $this->mPage );
+                               $this->mTitle = Title::newFromRow( $row );
                        } else {
                                $this->mCurrent = false;
                                $this->mTitle = null;
@@ -601,6 +600,7 @@ class Revision {
        /**
         * Alias for getText(Revision::FOR_THIS_USER)
         *
+        * @deprecated
         * @return String
         */
        public function revText() {
@@ -835,6 +835,8 @@ class Revision {
                        $this->mTextId = $dbw->insertId();
                }
 
+               if ( $this->mComment === null ) $this->mComment = "";
+
                # Record the edit in revisions
                $rev_id = isset( $this->mId )
                        ? $this->mId
@@ -994,7 +996,6 @@ class Revision {
        public static function userCanBitfield( $bitfield, $field ) {
                if( $bitfield & $field ) { // aspect is deleted
                        global $wgUser;
-                       $permission = '';
                        if ( $bitfield & self::DELETED_RESTRICTED ) {
                                $permission = 'suppressrevision';
                        } elseif ( $field & self::DELETED_TEXT ) {