* @static
* @access public
*/
- function newFromURL( $url ) {
+ public static function newFromURL( $url ) {
global $wgLegalTitleChars;
$t = new Title();
*/
function isProtected( $action = '' ) {
global $wgRestrictionLevels;
- if ( -1 == $this->mNamespace ) { return true; }
+ if ( NS_SPECIAL == $this->mNamespace ) { return true; }
if( $action == 'edit' || $action == '' ) {
$r = $this->getRestrictions( 'edit' );
global $wgUser;
if ( is_null( $this->mWatched ) ) {
- if ( -1 == $this->mNamespace || 0 == $wgUser->getID()) {
+ if ( NS_SPECIAL == $this->mNamespace || !$wgUser->isLoggedIn()) {
$this->mWatched = false;
} else {
$this->mWatched = $wgUser->isWatched( $this );
* Always grant access to the login page.
* Even anons need to be able to log in.
*/
- if( $this->getNamespace() == NS_SPECIAL
- && $this->getText() == 'Userlogin' ) {
+ if( $this->isSpecial( 'Userlogin' ) ) {
return true;
}
# We already know that some pages won't be in the database!
#
- if ( '' != $this->mInterwiki || -1 == $this->mNamespace ) {
+ if ( '' != $this->mInterwiki || NS_SPECIAL == $this->mNamespace ) {
$this->mArticleID = 0;
}
$f = strstr( $r, '#' );
return false;
}
- /**
- * Pages whose titles start with / can confuse webservers
- * and proxies. They can be unreachable with the pretty
- * URLs. Forbid them explicitly.
- */
- if ( strpos( $r, '/') === 0 )
- {
- return false;
- }
-
# We shouldn't need to query the DB for the size.
#$maxSize = $dbr->textFieldSize( 'page', 'page_title' );
if ( strlen( $r ) > 255 ) {
* @deprecated use DependencyWrapper
*/
function getRelatedCache( $memc, $key, $expiry, $callback, $params = array() ) {
- return DependencyWrapper::getValueFromCache( $memc, $key, $expiry, $callback,
+ return DependencyWrapper::getValueFromCache( $memc, $key, $expiry, $callback,
$params, new TitleDependency( $this ) );
}