From: Rob Church Date: Wed, 27 Dec 2006 07:47:10 +0000 (+0000) Subject: Clean up Title::isSemiProtected() and make it return false if the page doesn't exist X-Git-Tag: 1.31.0-rc.0~54752 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=b27da85617ac2610a6d28a9377a6f22883e699f4;p=lhc%2Fweb%2Fwiklou.git Clean up Title::isSemiProtected() and make it return false if the page doesn't exist --- diff --git a/includes/Title.php b/includes/Title.php index a6145e89d6..96df51d4e5 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -989,14 +989,15 @@ class Title { * @return bool */ function isSemiProtected( $action = 'edit' ) { - $restrictions = $this->getRestrictions( $action ); - # We do a full compare because this could be an array - foreach( $restrictions as $restriction ) { - if( strtolower( $restriction ) != 'autoconfirmed' ) { - return( false ); + if( $this->exists() ) { + foreach( $this->getRestrictions( $action ) as $restriction ) { + if( strtolower( $restriction ) != 'autoconfirmed' ) + return false; } + } else { + # If it doesn't exist, it can't be protected + return false; } - return( true ); } /**