| Index: trunk/phase3/includes/Article.php |
| — | — | @@ -71,7 +71,7 @@ |
| 72 | 72 | return $this->mRedirectTarget; |
| 73 | 73 | |
| 74 | 74 | # Query the redirect table |
| 75 | | - $dbr = wfGetDb(DB_SLAVE); |
| | 75 | + $dbr = wfGetDB(DB_SLAVE); |
| 76 | 76 | $res = $dbr->select('redirect', |
| 77 | 77 | array('rd_namespace', 'rd_title'), |
| 78 | 78 | array('rd_from' => $this->getID()), |
| — | — | @@ -95,7 +95,7 @@ |
| 96 | 96 | $retval = Title::newFromRedirect($this->getContent()); |
| 97 | 97 | if(!$retval) |
| 98 | 98 | return null; |
| 99 | | - $dbw = wfGetDb(DB_MASTER); |
| | 99 | + $dbw = wfGetDB(DB_MASTER); |
| 100 | 100 | $dbw->insert('redirect', array( |
| 101 | 101 | 'rd_from' => $this->getID(), |
| 102 | 102 | 'rd_namespace' => $retval->getNamespace(), |
| — | — | @@ -105,10 +105,18 @@ |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /** |
| | 109 | + * Get the Title object this page redirects to |
| | 110 | + * |
| | 111 | + * @param bool $getFragment should the fragment be set on the title |
| 109 | 112 | * @return mixed false, Title of in-wiki target, or string with URL |
| 110 | 113 | */ |
| 111 | | - function followRedirect() { |
| 112 | | - $rt = $this->getRedirectTarget(); |
| | 114 | + function followRedirect( $getFragment = false ) { |
| | 115 | + if( $getFragment ) |
| | 116 | + // We'll need to use the content of this page, as Article::getRedirectTarget() |
| | 117 | + // now loads the data from redirect table, wich doesn't store the fragment |
| | 118 | + $rt = Title::newFromRedirect( $this->getContent() ); |
| | 119 | + else |
| | 120 | + $rt = $this->getRedirectTarget(); |
| 113 | 121 | |
| 114 | 122 | # process if title object is valid and not special:userlogout |
| 115 | 123 | if( $rt ) { |
| Index: trunk/phase3/includes/Wiki.php |
| — | — | @@ -270,7 +270,6 @@ |
| 271 | 271 | * |
| 272 | 272 | * @param Title $title |
| 273 | 273 | * @param Request $request |
| 274 | | - * @param string $action |
| 275 | 274 | * @return mixed an Article, or a string to redirect to another URL |
| 276 | 275 | */ |
| 277 | 276 | function initializeArticle( &$title, $request ) { |
| — | — | @@ -289,7 +288,7 @@ |
| 290 | 289 | |
| 291 | 290 | // Follow redirects only for... redirects |
| 292 | 291 | if( $article->mIsRedirect ) { |
| 293 | | - $target = $article->followRedirect(); |
| | 292 | + $target = $article->followRedirect( true /* getFragment */ ); |
| 294 | 293 | if( is_string( $target ) ) { |
| 295 | 294 | if( !$this->getVal( 'DisableHardRedirects' ) ) { |
| 296 | 295 | // we'll need to redirect |
| Index: trunk/phase3/RELEASE-NOTES |
| — | — | @@ -183,8 +183,8 @@ |
| 184 | 184 | * (bug 13736) Don't show MediaWiki:Anontalkpagetext on non-existant IP addresses |
| 185 | 185 | * (bug 13728) Don't trim initial whitespace during section edits |
| 186 | 186 | * (bug 13727) Don't delete log entries from recentchanges on page deletion |
| | 187 | +* (bug 13752) Section redirects now works again |
| 187 | 188 | |
| 188 | | - |
| 189 | 189 | === API changes in 1.13 === |
| 190 | 190 | |
| 191 | 191 | * Fixing main page display in meta=siteinfo |