Update Postgres with missing uploadstash tables
[lhc/web/wiklou.git] / includes / RecentChange.php
index a3a42e6..d59f1aa 100644 (file)
@@ -467,72 +467,7 @@ class RecentChange {
                        'newSize' => $size
                );
                $rc->save();
-               return $rc;     
-       }
-
-       # Makes an entry in the database corresponding to a rename
-
-       /**
-        * @param $timestamp
-        * @param $oldTitle Title
-        * @param $newTitle Title
-        * @param $user User
-        * @param $comment
-        * @param $ip string
-        * @param $overRedir bool
-        * @return void
-        */
-       public static function notifyMove( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='',
-               $overRedir = false ) {
-               global $wgRequest;
-               if( !$ip ) {
-                       $ip = $wgRequest->getIP();
-                       if( !$ip ) $ip = '';
-               }
-
-               $rc = new RecentChange;
-               $rc->mAttribs = array(
-                       'rc_timestamp'  => $timestamp,
-                       'rc_cur_time'   => $timestamp,
-                       'rc_namespace'  => $oldTitle->getNamespace(),
-                       'rc_title'      => $oldTitle->getDBkey(),
-                       'rc_type'       => $overRedir ? RC_MOVE_OVER_REDIRECT : RC_MOVE,
-                       'rc_minor'      => 0,
-                       'rc_cur_id'     => $oldTitle->getArticleID(),
-                       'rc_user'       => $user->getId(),
-                       'rc_user_text'  => $user->getName(),
-                       'rc_comment'    => $comment,
-                       'rc_this_oldid' => 0,
-                       'rc_last_oldid' => 0,
-                       'rc_bot'        => $user->isAllowed( 'bot' ) ? $wgRequest->getBool( 'bot' , true ) : 0,
-                       'rc_moved_to_ns' => $newTitle->getNamespace(),
-                       'rc_moved_to_title' => $newTitle->getDBkey(),
-                       'rc_ip'         => $ip,
-                       'rc_new'        => 0, # obsolete
-                       'rc_patrolled'  => 1,
-                       'rc_old_len'    => null,
-                       'rc_new_len'    => null,
-                       'rc_deleted'    => 0,
-                       'rc_logid'      => 0, # notifyMove not used anymore
-                       'rc_log_type'   => null,
-                       'rc_log_action' => '',
-                       'rc_params'     => ''
-               );
-
-               $rc->mExtra = array(
-                       'prefixedDBkey' => $oldTitle->getPrefixedDBkey(),
-                       'lastTimestamp' => 0,
-                       'prefixedMoveTo' => $newTitle->getPrefixedDBkey()
-               );
-               $rc->save();
-       }
-
-       public static function notifyMoveToNew( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) {
-               RecentChange::notifyMove( $timestamp, $oldTitle, $newTitle, $user, $comment, $ip, false );
-       }
-
-       public static function notifyMoveOverRedirect( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) {
-               RecentChange::notifyMove( $timestamp, $oldTitle, $newTitle, $user, $comment, $ip, true );
+               return $rc;
        }
 
        public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip='', $type, 
@@ -686,7 +621,7 @@ class RecentChange {
                        $wgCanonicalServer, $wgScript;
 
                if( $this->mAttribs['rc_type'] == RC_LOG ) {
-                       $titleObj = Title::newFromText( 'Log/' . $this->mAttribs['rc_log_type'], NS_SPECIAL );
+                       $titleObj = SpecialPage::getTitleFor( 'Log', $this->mAttribs['rc_log_type'] );
                } else {
                        $titleObj =& $this->getTitle();
                }
@@ -710,8 +645,8 @@ class RecentChange {
                        $url .= $query;
                }
 
-               if( isset( $this->mExtra['oldSize'] ) && isset( $this->mExtra['newSize'] ) ) {
-                       $szdiff = $this->mExtra['newSize'] - $this->mExtra['oldSize'];
+               if( $this->mAttribs['rc_old_len'] !== null && $this->mAttribs['rc_new_len'] !== null ) {
+                       $szdiff = $this->mAttribs['rc_new_len'] - $this->mAttribs['rc_old_len'];
                        if($szdiff < -500) {
                                $szdiff = "\002$szdiff\002";
                        } elseif($szdiff >= 0) {