From: jenkins-bot Date: Mon, 19 Nov 2018 23:56:17 +0000 (+0000) Subject: Merge "Block: Clean up handling of non-User targets" X-Git-Tag: 1.34.0-rc.0~3474 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=1db4c42f46b538b45aff231989ab495b317aceda;p=lhc%2Fweb%2Fwiklou.git Merge "Block: Clean up handling of non-User targets" --- 1db4c42f46b538b45aff231989ab495b317aceda diff --cc includes/user/User.php index f429ab510c,bfa7266203..5f772a4531 --- a/includes/user/User.php +++ b/includes/user/User.php @@@ -2302,9 -2302,20 +2302,20 @@@ class User implements IDBAccessObject, $blocked = $this->isHidden(); if ( !$blocked ) { - $block = $this->getBlock( $fromSlave ); + $block = $this->getBlock( $fromReplica ); if ( $block ) { - $blocked = $block->preventsEdit( $title ); + // A sitewide block covers everything except maybe the user's + // talk page. A partial block covering the user's talk page + // overrides the editownusertalk flag, however. + // TODO: Do we really want a partial block on the user talk + // namespace to ignore editownusertalk? + $blocked = $block->isSitewide(); + if ( $blocked && $title->equals( $this->getTalkPage() ) ) { + $blocked = $block->prevents( 'editownusertalk' ); + } + if ( !$block->isSitewide() ) { + $blocked = $block->appliesToTitle( $title ); + } } }