]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch '1.0.x' into testing
authorEvan Prodromou <evan@status.net>
Thu, 21 Apr 2011 20:16:07 +0000 (16:16 -0400)
committerEvan Prodromou <evan@status.net>
Thu, 21 Apr 2011 20:16:07 +0000 (16:16 -0400)
lib/threadednoticelist.php
plugins/DomainWhitelist/DomainWhitelistPlugin.php
plugins/EmailRegistration/emailregister.php

index 221cf33aae5254431fb307707137ad033679bda7..32a417d7fab84038f04a40a903178da9c6d14393 100644 (file)
@@ -422,10 +422,9 @@ abstract class NoticeListActorsItem extends NoticeListItem
             } else {
                 $profile = Profile::staticGet('id', $id);
                 if ($profile) {
-                    $links[] = sprintf('<a href="%s" title="%s">%s</a>',
+                    $links[] = sprintf('<a href="%s">%s</a>',
                                        htmlspecialchars($profile->profileurl),
-                                       htmlspecialchars($profile->getBestName()),
-                                       htmlspecialchars($profile->nickname));
+                                       htmlspecialchars($profile->getBestName()));
                 }
             }
         }
@@ -477,22 +476,36 @@ class ThreadedNoticeListFavesItem extends NoticeListActorsItem
         return $profiles;
     }
 
+    function magicList($items)
+    {
+        if (count($items) > 4) {
+            return parent::magicList(array_slice($items, 0, 3));
+        } else {
+            return parent::magicList($items);
+        }
+    }
+
     function getListMessage($count, $you)
     {
         if ($count == 1 && $you) {
             // darn first person being different from third person!
             // TRANS: List message for notice favoured by logged in user.
-            return _m('FAVELIST', 'You have favored this notice.');
+            return _m('FAVELIST', 'You like this.');
+        } else if ($count > 4) {
+            // TRANS: List message for when more than 4 people like something.
+            return sprintf(_m('FAVELIST', '%%s and %d others like this.'),
+                           $count - 3);
         } else {
             // TRANS: List message for favoured notices.
             // TRANS: %d is the number of users that have favoured a notice.
-            return sprintf(_m('One person has favored this notice.',
-                              '%d people have favored this notice.',
+            return sprintf(_m('%%s likes this.',
+                              '%%s like this.',
                               $count),
                            $count);
         }
     }
 
+    
     function showStart()
     {
         $this->out->elementStart('li', array('class' => 'notice-data notice-faves'));
index 8fab835991bccd91f1b13f18894a133dc79288fe..bb63f666a15c90e7f288b9421be2b48d244abe33 100644 (file)
@@ -104,7 +104,7 @@ class DomainWhitelistPlugin extends Plugin
 
         $parts = explode('@', $email);
 
-        $userDomain = strtolower($parts[1]);
+        $userDomain = strtolower(trim($parts[1]));
 
         return in_array($userDomain, $whitelist);
     }
index 3afac7d1f57cf296abba7e5d6964c5e8ed374776..d5ccf79f46f48a2329c3fd788ef8461dba1c1036 100644 (file)
@@ -241,9 +241,9 @@ class EmailregisterAction extends Action
     function setPassword()
     {
         if (!empty($this->invitation)) {
-            $email = $this->invitation->address;
+            $email = trim($this->invitation->address);
         } else if (!empty($this->confirmation)) {
-            $email = $this->confirmation->address;
+            $email = trim($this->confirmation->address);
         } else {
             throw new Exception('No confirmation thing.');
         }