- public function preventsEdit( \Title $title ) {
- $blocked = $this->isSitewide();
-
- // user talk page has it's own rules
- // This check happens before partial blocks because the flag
- // to allow user to edit their user talk page could be
- // overwritten by a partial block restriction (E.g. user talk namespace)
- $user = $this->getTarget();
- if ( $title->equals( $user->getTalkPage() ) ) {
- $blocked = $this->prevents( 'editownusertalk' );
- }
-
- if ( !$this->isSitewide() ) {
- $restrictions = $this->getRestrictions();
- foreach ( $restrictions as $restriction ) {
- if ( $restriction->matches( $title ) ) {
- $blocked = true;
- }
+ public function appliesToTitle( Title $title ) {
+ if ( $this->isSitewide() ) {
+ return true;
+ }
+
+ $restrictions = $this->getRestrictions();
+ foreach ( $restrictions as $restriction ) {
+ if ( $restriction->matches( $title ) ) {
+ return true;