From 1382e6efa5d33130a415e83d949a3cefbcf6447b Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Mon, 22 Jan 2007 16:53:28 +0000 Subject: [PATCH 1/1] * Use 1movedto2_redir instead of 1movedto2 in the pages history when moving over redirects. * Removing Title::createRedirect: not used at all in trunk and in the extensions, originally created for the old template namespace script, which was deleted. --- includes/FakeTitle.php | 1 - includes/Title.php | 42 +----------------------------------------- 2 files changed, 1 insertion(+), 42 deletions(-) diff --git a/includes/FakeTitle.php b/includes/FakeTitle.php index 112d2a6b94..079c635cf7 100644 --- a/includes/FakeTitle.php +++ b/includes/FakeTitle.php @@ -72,7 +72,6 @@ class FakeTitle { function moveOverExistingRedirect() { $this->error(); } function moveToNewTitle() { $this->error(); } function isValidMoveTarget() { $this->error(); } - function createRedirect() { $this->error(); } function getParentCategories() { $this->error(); } function getParentCategoryTree() { $this->error(); } function pageCond() { $this->error(); } diff --git a/includes/Title.php b/includes/Title.php index bc5af31179..cf1f446a9b 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2163,7 +2163,7 @@ class Title { function moveOverExistingRedirect( &$nt, $reason = '' ) { global $wgUseSquid; $fname = 'Title::moveOverExistingRedirect'; - $comment = wfMsgForContent( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() ); + $comment = wfMsgForContent( '1movedto2_redir', $this->getPrefixedText(), $nt->getPrefixedText() ); if ( $reason ) { $comment .= ": $reason"; @@ -2359,46 +2359,6 @@ class Title { return $row === false; } - /** - * Create a redirect; fails if the title already exists; does - * not notify RC - * - * @param Title $dest the destination of the redirect - * @param string $comment the comment string describing the move - * @return bool true on success - * @access public - */ - function createRedirect( $dest, $comment ) { - if ( $this->getArticleID() ) { - return false; - } - - $fname = 'Title::createRedirect'; - $dbw =& wfGetDB( DB_MASTER ); - - $article = new Article( $this ); - $newid = $article->insertOn( $dbw ); - $revision = new Revision( array( - 'page' => $newid, - 'comment' => $comment, - 'text' => "#REDIRECT [[" . $dest->getPrefixedText() . "]]\n", - ) ); - $revision->insertOn( $dbw ); - $article->updateRevisionOn( $dbw, $revision, 0 ); - - # Link table - $dbw->insert( 'pagelinks', - array( - 'pl_from' => $newid, - 'pl_namespace' => $dest->getNamespace(), - 'pl_title' => $dest->getDbKey() - ), $fname - ); - - Article::onArticleCreate( $this ); - return true; - } - /** * Get categories to which this Title belongs and return an array of * categories' names. -- 2.20.1