Index: trunk/phase3/includes/Title.php |
— | — | @@ -2572,6 +2572,7 @@ |
2573 | 2573 | } |
2574 | 2574 | |
2575 | 2575 | $pageid = $this->getArticleID(); |
| 2576 | + $protected = $this->isProtected(); |
2576 | 2577 | if( $nt->exists() ) { |
2577 | 2578 | $err = $this->moveOverExistingRedirect( $nt, $reason, $createRedirect ); |
2578 | 2579 | $pageCountChange = ($createRedirect ? 0 : -1); |
— | — | @@ -2606,8 +2607,28 @@ |
2607 | 2608 | 'cl_sortkey' => $this->getPrefixedText() ), |
2608 | 2609 | __METHOD__ ); |
2609 | 2610 | |
| 2611 | + if( $protected ) { |
| 2612 | + # Protect the redirect title as the title used to be... |
| 2613 | + $dbw->insertSelect( 'page_restrictions', 'page_restrictions', |
| 2614 | + array( |
| 2615 | + 'pr_page' => $redirid, |
| 2616 | + 'pr_type' => 'pr_type', |
| 2617 | + 'pr_level' => 'pr_level', |
| 2618 | + 'pr_cascade' => 'pr_cascade', |
| 2619 | + 'pr_user' => 'pr_user', |
| 2620 | + 'pr_expiry' => 'pr_expiry' |
| 2621 | + ), |
| 2622 | + array( 'pr_page' => $pageid ), |
| 2623 | + __METHOD__, |
| 2624 | + array( 'IGNORE' ) |
| 2625 | + ); |
| 2626 | + # Update the protection log |
| 2627 | + $log = new LogPage( 'protect' ); |
| 2628 | + $comment = wfMsgForContent('1movedto2',$this->getPrefixedText(), $nt->getPrefixedText() ); |
| 2629 | + $log->addEntry( 'protect', $nt, $comment, array() ); // FIXME: $params? |
| 2630 | + } |
| 2631 | + |
2610 | 2632 | # Update watchlists |
2611 | | - |
2612 | 2633 | $oldnamespace = $this->getNamespace() & ~1; |
2613 | 2634 | $newnamespace = $nt->getNamespace() & ~1; |
2614 | 2635 | $oldtitle = $this->getDBkey(); |