Merge "mediawiki.jqueryMsg: Support {{GENDER:}} with empty first parameter"
[lhc/web/wiklou.git] / includes / Title.php
index 64e6566..ab79d6d 100644 (file)
@@ -1780,7 +1780,6 @@ class Title {
         *
         * @deprecated in 1.19; use userCan(), quickUserCan() or getUserPermissionsErrors() instead
         * @return Bool
-        * @todo fold these checks into userCan()
         */
        public function userCanRead() {
                wfDeprecated( __METHOD__, '1.19' );
@@ -3877,7 +3876,20 @@ class Title {
                                $comment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $reason;
                        }
                        // @todo FIXME: $params?
-                       $log->addEntry( 'move_prot', $nt, $comment, array( $this->getPrefixedText() ), $wgUser );
+                       $logId = $log->addEntry( 'move_prot', $nt, $comment, array( $this->getPrefixedText() ), $wgUser );
+
+                       // reread inserted pr_ids for log relation
+                       $insertedPrIds = $dbw->select(
+                               'page_restrictions',
+                               'pr_id',
+                               array( 'pr_page' => $redirid ),
+                               __METHOD__
+                       );
+                       $logRelationsValues = array();
+                       foreach ( $insertedPrIds as $prid ) {
+                               $logRelationsValues[] = $prid->pr_id;
+                       }
+                       $log->addRelations( 'pr_id', $logRelationsValues, $logId );
                }
 
                # Update watchlists