]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'master' into 0.9.x
authorBrion Vibber <brion@pobox.com>
Mon, 28 Feb 2011 18:18:18 +0000 (10:18 -0800)
committerBrion Vibber <brion@pobox.com>
Mon, 28 Feb 2011 18:18:18 +0000 (10:18 -0800)
1  2 
classes/Notice.php
lib/util.php

diff --combined classes/Notice.php
index a25991fa322fc779d17299fa5944ba2a7a9caaa8,a26a6f0f0d2b28feda30d53a693e5a09247524be..141ae8fd44883c3cb012214fd1a35b239d33801e
@@@ -153,7 -153,7 +153,7 @@@ class Notice extends Memcached_DataObje
      function saveTags()
      {
          /* extract all #hastags */
 -        $count = preg_match_all('/(?:^|\s)#([\pL\pN_\-\.]{1,64})/', strtolower($this->content), $match);
 +        $count = preg_match_all('/(?:^|\s)#([\pL\pN_\-\.]{1,64})/u', strtolower($this->content), $match);
          if (!$count) {
              return true;
          }
  
              $reply->notice_id  = $this->id;
              $reply->profile_id = $profile->id;
+             $reply->modified   = $this->created;
  
              common_log(LOG_INFO, __METHOD__ . ": saving reply: notice $this->id to profile $profile->id");
  
  
                  $reply->notice_id  = $this->id;
                  $reply->profile_id = $mentioned->id;
+                 $reply->modified   = $this->created;
  
                  $id = $reply->insert();
  
       * @return Activity activity object representing this Notice.
       */
  
 -    function asActivity()
 +    function asActivity($cur)
      {
          $act = self::cacheGet(Cache::codeKey('notice:as-activity:'.$this->id));
  
          if (!empty($act)) {
              return $act;
          }
 -
          $act = new Activity();
  
          if (Event::handle('StartNoticeAsActivity', array($this, &$act))) {
  
              $profile = $this->getProfile();
  
 -            $act->actor     = ActivityObject::fromProfile($profile);
 -            $act->verb      = ActivityVerb::POST;
 -            $act->objects[] = ActivityObject::fromNotice($this);
 +            $act->actor            = ActivityObject::fromProfile($profile);
 +            $act->actor->extra[]   = $profile->profileInfo($cur);
 +            $act->verb             = ActivityVerb::POST;
 +            $act->objects[]        = ActivityObject::fromNotice($this);
  
              // XXX: should this be handled by default processing for object entry?
  
                           $author=true,
                           $cur=null)
      {
 -        $act = $this->asActivity();
 +        $act = $this->asActivity($cur);
          $act->extra[] = $this->noticeInfo($cur);
          return $act->asString($namespace, $author, $source);
      }
diff --combined lib/util.php
index f734062eced327cec4423eaf9732634778af207d,8dd22de59248d019ad62e13ff023b0a6d004fafb..e5b0c86e06160599436901a3f84c4a8717d2932e
@@@ -300,10 -300,7 +300,10 @@@ function common_set_user($user
  
      if ($user) {
          if (Event::handle('StartSetUser', array(&$user))) {
 -            if($user){
 +            if (!empty($user)) {
 +                if (!$user->hasRight(Right::WEBLOGIN)) {
 +                    throw new AuthorizationException(_('Not allowed to log in.'));
 +                }
                  common_ensure_session();
                  $_SESSION['userid'] = $user->id;
                  $_cur = $user;
@@@ -787,7 -784,7 +787,7 @@@ function common_render_text($text
  
      $r = preg_replace('/[\x{0}-\x{8}\x{b}-\x{c}\x{e}-\x{19}]/', '', $r);
      $r = common_replace_urls_callback($r, 'common_linkify');
 -    $r = preg_replace('/(^|\&quot\;|\'|\(|\[|\{|\s+)#([\pL\pN_\-\.]{1,64})/e', "'\\1#'.common_tag_link('\\2')", $r);
 +    $r = preg_replace('/(^|\&quot\;|\'|\(|\[|\{|\s+)#([\pL\pN_\-\.]{1,64})/ue', "'\\1#'.common_tag_link('\\2')", $r);
      // XXX: machine tags
      return $r;
  }
@@@ -925,11 -922,11 +925,11 @@@ function common_linkify($url) 
      // functions
      $url = htmlspecialchars_decode($url);
  
-    if(strpos($url, '@') !== false && strpos($url, ':') === false) {
-        //url is an email address without the mailto: protocol
-        $canon = "mailto:$url";
-        $longurl = "mailto:$url";
-    }else{
+     if (strpos($url, '@') !== false && strpos($url, ':') === false && Validate::email($url)) {
+         //url is an email address without the mailto: protocol
+         $canon = "mailto:$url";
+         $longurl = "mailto:$url";
+     } else {
  
          $canon = File_redirection::_canonUrl($url);