X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FUser.php;h=a762cd0c077c215e9558339251d401f97f1a5ab1;hb=11cb289cfc45fd40056bccae208934b11c98c10e;hp=e7c5a326f432b344c6ff99faf05f48df25921903;hpb=1a13143dac37d5eba5e01dd608e771175a64699d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/User.php b/includes/User.php index e7c5a326f4..a762cd0c07 100644 --- a/includes/User.php +++ b/includes/User.php @@ -465,7 +465,7 @@ class User { * user_name and user_real_name are not provided because the whole row * will be loaded once more from the database when accessing them. * - * @param array $row A row from the user table + * @param stdClass $row A row from the user table * @param array $data Further data to load into the object (see User::loadFromRow for valid keys) * @return User */ @@ -2450,6 +2450,8 @@ class User { * - 'registered-checkmatrix' - as above, using the 'checkmatrix' type. * - 'userjs' - preferences with names starting with 'userjs-', intended to * be used by user scripts. + * - 'special' - "preferences" that are not accessible via User::getOptions + * or User::setOptions. * - 'unused' - preferences about which MediaWiki doesn't know anything. * These are usually legacy options, removed in newer versions. * @@ -2466,6 +2468,7 @@ class User { 'registered-multiselect', 'registered-checkmatrix', 'userjs', + 'special', 'unused' ); } @@ -2490,6 +2493,13 @@ class User { $prefs = Preferences::getPreferences( $this, $context ); $mapping = array(); + // Pull out the "special" options, so they don't get converted as + // multiselect or checkmatrix. + $specialOptions = array_fill_keys( Preferences::getSaveBlacklist(), true ); + foreach ( $specialOptions as $name => $value ) { + unset( $prefs[$name] ); + } + // Multiselect and checkmatrix options are stored in the database with // one key per option, each having a boolean value. Extract those keys. $multiselectOptions = array(); @@ -2532,6 +2542,8 @@ class User { $mapping[$key] = 'registered-multiselect'; } elseif ( isset( $checkmatrixOptions[$key] ) ) { $mapping[$key] = 'registered-checkmatrix'; + } elseif ( isset( $specialOptions[$key] ) ) { + $mapping[$key] = 'special'; } elseif ( substr( $key, 0, 7 ) === 'userjs-' ) { $mapping[$key] = 'userjs'; } else { @@ -3777,8 +3789,9 @@ class User { */ public function sendMail( $subject, $body, $from = null, $replyto = null ) { if ( is_null( $from ) ) { - global $wgPasswordSender, $wgPasswordSenderName; - $sender = new MailAddress( $wgPasswordSender, $wgPasswordSenderName ); + global $wgPasswordSender; + $sender = new MailAddress( $wgPasswordSender, + wfMessage( 'emailsender' )->inContentLanguage()->text() ); } else { $sender = new MailAddress( $from ); }