Add missing & to @param documentation to match functon call
[lhc/web/wiklou.git] / includes / changes / RecentChange.php
index 35f8b3b..64c5555 100644 (file)
@@ -130,7 +130,7 @@ class RecentChange {
                if ( is_array( $type ) ) {
                        $retval = [];
                        foreach ( $type as $t ) {
-                               $retval[] = RecentChange::parseToRCType( $t );
+                               $retval[] = self::parseToRCType( $t );
                        }
 
                        return $retval;
@@ -459,7 +459,7 @@ class RecentChange {
 
                $change = $change instanceof RecentChange
                        ? $change
-                       : RecentChange::newFromId( $change );
+                       : self::newFromId( $change );
 
                if ( !$change instanceof RecentChange ) {
                        return null;
@@ -552,9 +552,9 @@ class RecentChange {
         * Makes an entry in the database corresponding to an edit
         *
         * @param string $timestamp
-        * @param Title $title
+        * @param Title &$title
         * @param bool $minor
-        * @param User $user
+        * @param User &$user
         * @param string $comment
         * @param int $oldId
         * @param string $lastTimestamp
@@ -629,9 +629,9 @@ class RecentChange {
         * Note: the title object must be loaded with the new id using resetArticleID()
         *
         * @param string $timestamp
-        * @param Title $title
+        * @param Title &$title
         * @param bool $minor
-        * @param User $user
+        * @param User &$user
         * @param string $comment
         * @param bool $bot
         * @param string $ip
@@ -699,8 +699,8 @@ class RecentChange {
 
        /**
         * @param string $timestamp
-        * @param Title $title
-        * @param User $user
+        * @param Title &$title
+        * @param User &$user
         * @param string $actionComment
         * @param string $ip
         * @param string $type
@@ -730,8 +730,8 @@ class RecentChange {
 
        /**
         * @param string $timestamp
-        * @param Title $title
-        * @param User $user
+        * @param Title &$title
+        * @param User &$user
         * @param string $actionComment
         * @param string $ip
         * @param string $type
@@ -911,7 +911,16 @@ class RecentChange {
        public function loadFromRow( $row ) {
                $this->mAttribs = get_object_vars( $row );
                $this->mAttribs['rc_timestamp'] = wfTimestamp( TS_MW, $this->mAttribs['rc_timestamp'] );
-               $this->mAttribs['rc_deleted'] = $row->rc_deleted; // MUST be set
+               // rc_deleted MUST be set
+               $this->mAttribs['rc_deleted'] = $row->rc_deleted;
+
+               if ( isset( $this->mAttribs['rc_ip'] ) ) {
+                       // Clean up CIDRs for Postgres per T164898. ("127.0.0.1" casts to "127.0.0.1/32")
+                       $n = strpos( $this->mAttribs['rc_ip'], '/' );
+                       if ( $n !== false ) {
+                               $this->mAttribs['rc_ip'] = substr( $this->mAttribs['rc_ip'], 0, $n );
+                       }
+               }
        }
 
        /**