From 8ca3f081358fefc00eb07c988f570d373bc6608f Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 11 Sep 2004 09:35:24 +0000 Subject: [PATCH] unreported bug in the new makeTitle(), disallow redirects to Special:Userlogout --- includes/Title.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/Title.php b/includes/Title.php index 3a17b3b052..e577493538 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -147,7 +147,7 @@ class Title { $t->mFragment = ''; $t->mNamespace = $ns; $t->mDbkeyform = $title; - $t->mArticleID = ( $ns >= 0 ) ? 0 : -1; + $t->mArticleID = ( $ns >= 0 ) ? -1 : 0; $t->mUrlform = wfUrlencode( $title ); $t->mTextform = str_replace( '_', ' ', $title ); return $t; @@ -185,6 +185,10 @@ class Title { } $rt = Title::newFromText( $m[1] ); + # Disallow redirects to Special:Userlogout + if ( $rt->getNamespace() == NS_SPECIAL && preg_match( '/^Userlogout/i', $rt->getText ) ) { + $rt = NULL; + } } } return $rt; -- 2.20.1