]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'testing' into 0.9.x
authorBrion Vibber <brion@pobox.com>
Mon, 15 Mar 2010 19:45:38 +0000 (12:45 -0700)
committerBrion Vibber <brion@pobox.com>
Mon, 15 Mar 2010 19:45:38 +0000 (12:45 -0700)
1  2 
actions/shownotice.php

diff --combined actions/shownotice.php
index a1933ff631d6e287110f0272d761749bb5eee0a7,a23027f7c5f6858f308008c647c9e21fe576691e..ca6b60d1f59b15de87d5f047002fffbc5ebd0591
@@@ -103,11 -103,6 +103,6 @@@ class ShownoticeAction extends OwnerDes
  
          $this->user = User::staticGet('id', $this->profile->id);
  
-         if ($this->notice->is_local == Notice::REMOTE_OMB) {
-             common_redirect($this->notice->uri);
-             return false;
-         }
          $this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
  
          return true;
      function title()
      {
          if (!empty($this->profile->fullname)) {
 -            $base = $this->profile->fullname . ' (' . $this->profile->nickname . ') ';
 +            $base = $this->profile->fullname . ' (' . $this->profile->nickname . ')';
          } else {
              $base = $this->profile->nickname;
          }
  
          if ($this->notice->is_local == Notice::REMOTE_OMB) {
              if (!empty($this->notice->url)) {
-                 common_redirect($this->notice->url, 301);
+                 $target = $this->notice->url;
              } else if (!empty($this->notice->uri) && preg_match('/^https?:/', $this->notice->uri)) {
-                 common_redirect($this->notice->uri, 301);
+                 // Old OMB posts saved the remote URL only into the URI field.
+                 $target = $this->notice->uri;
+             } else {
+                 // Shouldn't happen.
+                 $target = false;
+             }
+             if ($target && $target != $this->selfUrl()) {
+                 common_redirect($target, 301);
+                 return false;
              }
-         } else {
-             $this->showPage();
          }
+         $this->showPage();
      }
  
      /**