IAlex has uploaded a new change for review.
https://gerrit.wikimedia.org/r/75840
Change subject: Follow-up I3f03dd0100 (08adf46): simplify checks
......................................................................
Follow-up I3f03dd0100 (08adf46): simplify checks
Those variables are only used when $canViewPrivateInfo is true;
so no need set them when it is not the case
Change-Id: I87a27ea94f3eadc757b6e6048437a7ec58d09d03
---
M includes/Preferences.php
1 file changed, 23 insertions(+), 23 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/40/75840/1
diff --git a/includes/Preferences.php b/includes/Preferences.php
index 16a7a6c..eaa2b22 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -397,30 +397,30 @@
## Email stuff
if ( $wgEnableEmail ) {
- $helpMessages[] = $wgEmailConfirmToEdit
- ? 'prefs-help-email-required'
- : 'prefs-help-email';
-
- if ( $wgEnableUserEmail ) {
- // additional messages when users can send
email to each other
- $helpMessages[] = 'prefs-help-email-others';
- }
-
- $link = Linker::link(
- SpecialPage::getTitleFor( 'ChangeEmail' ),
- $context->msg( $user->getEmail() ?
'prefs-changeemail' : 'prefs-setemail' )->escaped(),
- array(),
- array( 'returnto' => SpecialPage::getTitleFor(
'Preferences' )->getPrefixedText() ) );
-
- $emailAddress = $user->getEmail() ? htmlspecialchars(
$user->getEmail() ) : '';
- if ( $canEditPrivateInfo && $wgAuth->allowPropChange(
'emailaddress' ) ) {
- $emailAddress .= $emailAddress == '' ? $link : (
- $context->msg( 'word-separator'
)->plain()
- . $context->msg( 'parentheses'
)->rawParams( $link )->plain()
- );
- }
-
if ( $canViewPrivateInfo ) {
+ $helpMessages[] = $wgEmailConfirmToEdit
+ ? 'prefs-help-email-required'
+ : 'prefs-help-email';
+
+ if ( $wgEnableUserEmail ) {
+ // additional messages when users can
send email to each other
+ $helpMessages[] =
'prefs-help-email-others';
+ }
+
+ $link = Linker::link(
+ SpecialPage::getTitleFor( 'ChangeEmail'
),
+ $context->msg( $user->getEmail() ?
'prefs-changeemail' : 'prefs-setemail' )->escaped(),
+ array(),
+ array( 'returnto' =>
SpecialPage::getTitleFor( 'Preferences' )->getPrefixedText() ) );
+
+ $emailAddress = $user->getEmail() ?
htmlspecialchars( $user->getEmail() ) : '';
+ if ( $wgAuth->allowPropChange( 'emailaddress' )
) {
+ $emailAddress .= $emailAddress == '' ?
$link : (
+ $context->msg( 'word-separator'
)->plain()
+ . $context->msg( 'parentheses'
)->rawParams( $link )->plain()
+ );
+ }
+
$defaultPreferences['emailaddress'] = array(
'type' => 'info',
'raw' => true,
--
To view, visit https://gerrit.wikimedia.org/r/75840
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I87a27ea94f3eadc757b6e6048437a7ec58d09d03
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits