* (bug 13736) Don't show MediaWiki:Anontalkpagetext on non-existant IP addresses
* (bug 13728) Don't trim initial whitespace during section edits
* (bug 13727) Don't delete log entries from recentchanges on page deletion
-
+* (bug 13752) Section redirects now works again
=== API changes in 1.13 ===
return $this->mRedirectTarget;
# Query the redirect table
- $dbr = wfGetDb(DB_SLAVE);
+ $dbr = wfGetDB(DB_SLAVE);
$res = $dbr->select('redirect',
array('rd_namespace', 'rd_title'),
array('rd_from' => $this->getID()),
$retval = Title::newFromRedirect($this->getContent());
if(!$retval)
return null;
- $dbw = wfGetDb(DB_MASTER);
+ $dbw = wfGetDB(DB_MASTER);
$dbw->insert('redirect', array(
'rd_from' => $this->getID(),
'rd_namespace' => $retval->getNamespace(),
}
/**
+ * Get the Title object this page redirects to
+ *
+ * @param bool $getFragment should the fragment be set on the title
* @return mixed false, Title of in-wiki target, or string with URL
*/
- function followRedirect() {
- $rt = $this->getRedirectTarget();
+ function followRedirect( $getFragment = false ) {
+ if( $getFragment )
+ // We'll need to use the content of this page, as Article::getRedirectTarget()
+ // now loads the data from redirect table, wich doesn't store the fragment
+ $rt = Title::newFromRedirect( $this->getContent() );
+ else
+ $rt = $this->getRedirectTarget();
# process if title object is valid and not special:userlogout
if( $rt ) {
*
* @param Title $title
* @param Request $request
- * @param string $action
* @return mixed an Article, or a string to redirect to another URL
*/
function initializeArticle( &$title, $request ) {
// Follow redirects only for... redirects
if( $article->mIsRedirect ) {
- $target = $article->followRedirect();
+ $target = $article->followRedirect( true /* getFragment */ );
if( is_string( $target ) ) {
if( !$this->getVal( 'DisableHardRedirects' ) ) {
// we'll need to redirect