Add a version number and user-agent string to ForeignAPIRepo.
[lhc/web/wiklou.git] / includes / User.php
index 6d44b8d..63b1a6a 100644 (file)
@@ -655,8 +655,8 @@ class User {
                ^                      # start of string
                [$rfc5322_atext\\.]+    # user part which is liberal :p
                @                      # 'apostrophe'
-               [$rfc1034_ldh_str]     # Domain first character
-               [$rfc1034_ldh_str\\.]+  # Second char and following can include dot
+               [$rfc1034_ldh_str]+       # First domain part
+               (\\.[$rfc1034_ldh_str]+)+  # Following part prefixed with a dot
                $                      # End of string
                /ix" ; // case Insensitive, eXtended 
 
@@ -2276,18 +2276,18 @@ class User {
        private function createSkinObject() {
                wfProfileIn( __METHOD__ );
 
-               global $wgHiddenPrefs, $wgRequest;
+               global $wgHiddenPrefs;
                if( !in_array( 'skin', $wgHiddenPrefs ) ) {
+                       global $wgRequest;
                        # get the user skin
                        $userSkin = $this->getOption( 'skin' );
+                       $userSkin = $wgRequest->getVal( 'useskin', $userSkin );
                } else {
                        # if we're not allowing users to override, then use the default
                        global $wgDefaultSkin;
                        $userSkin = $wgDefaultSkin;
                }
 
-               $userSkin = $wgRequest->getVal( 'useskin', $userSkin );
-
                $skin = Skin::newFromKey( $userSkin );
                wfProfileOut( __METHOD__ );
                
@@ -2957,12 +2957,13 @@ class User {
         */
        function sendMail( $subject, $body, $from = null, $replyto = null ) {
                if( is_null( $from ) ) {
-                       global $wgPasswordSender;
-                       $from = $wgPasswordSender;
+                       global $wgPasswordSender, $wgPasswordSenderName;
+                       $sender = new MailAddress( $wgPasswordSender, $wgPasswordSenderName );
+               } else {
+                       $sender = new MailAddress( $from );
                }
 
                $to = new MailAddress( $this );
-               $sender = new MailAddress( $from );
                return UserMailer::send( $to, $sender, $subject, $body, $replyto );
        }