From f2aa2c6980460261f27bf01d3e074aa9b2d4bd5d Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 18 Jun 2010 20:28:22 +0000 Subject: Merging r6497:6499 to trunk. git-svn-id: http://code.elgg.org/elgg/trunk@6514 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/notification.php | 6 +++--- engine/lib/users.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/notification.php b/engine/lib/notification.php index 726f76993..7f949c32f 100644 --- a/engine/lib/notification.php +++ b/engine/lib/notification.php @@ -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. diff --git a/engine/lib/users.php b/engine/lib/users.php index fcc10133f..99ef15246 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -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)); } } -- cgit v1.2.3