]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Merging r6497:6499 to trunk.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 18 Jun 2010 20:28:22 +0000 (20:28 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 18 Jun 2010 20:28:22 +0000 (20:28 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6514 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/notification.php
engine/lib/users.php
languages/en.php

index 726f76993487a9e5a20487980de3e161c8192373..7f949c32ff5599abd923838bcedccbfb845d008e 100644 (file)
@@ -249,10 +249,10 @@ function email_notify_handler(ElggEntity $from, ElggUser $to, $subject, $message
        // From
        $site = get_entity($CONFIG->site_guid);
        // If there's an email address, use it - but only if its not from a user.
-       if ((isset($from->email)) && (!($from instanceof ElggUser))) {
+       if (!($from instanceof ElggUser) && $from->email) {
                $from = $from->email;
-       } else if (($site) && (isset($site->email))) {
-               // Has the current site got a from email address?
+       } else if ($site && $site->email) {
+               // Use email address of current site if we cannot use sender's email
                $from = $site->email;
        } else {
                // If all else fails, use the domain of the site.
index fcc10133f78a6008cc9f114c0f75b49ebb30634a..99ef15246ccaaa4584ca4d10b78f28340d1abb6c 100644 (file)
@@ -1435,10 +1435,10 @@ function validate_username($username) {
        }
 
        // Belts and braces TODO: Tidy into main unicode
-       $blacklist2 = '/\\"\'*& ?#%^(){}[]~?<>;|¬`@-+=';
+       $blacklist2 = '\'/\\"*& ?#%^(){}[]~?<>;|¬`@-+=';
        for ($n=0; $n < strlen($blacklist2); $n++) {
                if (strpos($username, $blacklist2[$n])!==false) {
-                       throw new RegistrationException(elgg_echo('registration:invalidchars'));
+                       throw new RegistrationException(sprintf(elgg_echo('registration:invalidchars'), $blacklist2[$n], $blacklist2));
                }
        }
 
index 004c6e9f9113324501f74540a1d75fe6ca5ca718..8136601b3a13b60465d88494f62c612631d636e3 100644 (file)
@@ -391,7 +391,7 @@ To remove a widget drag it back to the <b>Widget gallery</b>.",
        'registration:usernametooshort' => 'Your username must be a minimum of 4 characters long.',
        'registration:passwordtooshort' => 'The password must be a minimum of 6 characters long.',
        'registration:dupeemail' => 'This email address has already been registered.',
-       'registration:invalidchars' => 'Sorry, your username contains invalid characters.',
+       'registration:invalidchars' => 'Sorry, your username contains the following invalid character: %s.  All of these characters are invalid: %s',
        'registration:emailnotvalid' => 'Sorry, the email address you entered is invalid on this system',
        'registration:passwordnotvalid' => 'Sorry, the password you entered is invalid on this system',
        'registration:usernamenotvalid' => 'Sorry, the username you entered is invalid on this system',