]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Notice.php
Notice->getUrl() for shares would throw exception in some feeds
[quix0rs-gnu-social.git] / classes / Notice.php
index 7311a257a618180d3cdb688fbf8f7d73ea996784..b83af67563980ee9fbbe0de47a9b6ed959c1355d 100644 (file)
@@ -1493,7 +1493,12 @@ class Notice extends Managed_DataObject
 
             $act->id      = $this->uri;
             $act->time    = strtotime($this->created);
-            $act->link    = $this->getUrl();
+            try {
+                $act->link    = $this->getUrl();
+            } catch (InvalidUrlException $e) {
+                // The notice is probably a share or similar, which don't
+                // have a representational URL of their own.
+            }
             $act->content = common_xml_safe_str($this->rendered);
 
             $profile = $this->getProfile();