unreported bug in the new makeTitle(), disallow redirects to Special:Userlogout
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 11 Sep 2004 09:35:24 +0000 (09:35 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 11 Sep 2004 09:35:24 +0000 (09:35 +0000)
includes/Title.php

index 3a17b3b..e577493 100644 (file)
@@ -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;